C#

String을 토큰으로 String을 분리하여 Array로 저장

NuBiFoRM 2010. 7. 16. 13:25
public static Array Splits(String src, String tocken)
{
int index = 0;
ArrayList result = new ArrayList();
while((index = src.IndexOf(tocken)) != -1)
{
result.Add(src.Substring(0, index));
src = src.Substring(index + tocken.Length);
}
result.Add(src);
return result.ToArray();
}