split string to array
Published: 13. December 2008 | Updated: 26. October 2011License: Microsoft Public License (MS-PL)
Categories: Framework » Arrays
Tags: Array C#
char[] separators = { ',', ';' }; string text = "123,8946;6456,466,994,105;4"; string[] parts = text.Split(separators); foreach (string part in parts) { Console.WriteLine(part); }Console Output:
123
8946
6456
466
994
105
4
8946
6456
466
994
105
4
| Send us feedback about this snippet » |





