Esempio n. 1
0
		/// <summary>
		/// Key와 Value로 구분된 문자열에서 nTH번째에 해당하는 Key를 리턴함.
		/// </summary>
		/// <param name="nTH"></param>
		/// <param name="Default"></param>
		/// <returns></returns>
		public string GetKeyByIndex(int nTH, string Default)
		{
			int PosStart = 0, PosEnd = 0, PosOfnTH;

			if (nTH == 0)
			{
				PosStart = 0;
				PosEnd = mKeyValueList.IndexOf("!") - 1;
				if (PosEnd == -2)
				{
					return Default;
				}
			}
			else 
			{
				PosOfnTH = CFindRep.IndexOfnTH(mKeyValueList, mColDelim, nTH - 1);
				if (PosOfnTH == -1)
				{
					return Default;
				}

				PosStart = PosOfnTH + 1;
				PosEnd = mKeyValueList.IndexOf("!", PosStart) - 1;
				if (PosEnd == -2)
				{
					return Default;
				}
			}

			return mKeyValueList.Substring(PosStart, (PosEnd - PosStart) + 1);
		}