[C#] Dictionary <-> String 서로 변환하는 방법
2015. 7. 27.
게임개발을 하다가 아이템 정보라던지 유저정보 같은 것들을 Dictionary 에 값을 가지고 있다가 저장하고 싶을때 사용하면 좋을만한 방법 입니다. 먼저 테스트용 Dictionary 를 준비 합니다. Dictionary testDict = new Dictionary (); testDict.Add ( "1", "a" ); testDict.Add ( "2", "b" ); testDict.Add ( "3", "c" ); testDict.Add ( "4", "d" ); Dictionary -> String public static string ConvertDictionaryToString (Dictionary dict) { string format = "{0}='{1}',"; StringBuilder itemS..