Difference between revisions of "Split a string"
(Created page with "You can take a string and split it using a separating character: <syntaxhighlight lang=csharp line> Console.WriteLine("Comma separated strings"); // String of Vowels string v...") |
(No difference)
|
Revision as of 10:05, 20 May 2024
You can take a string and split it using a separating character:
1 Console.WriteLine("Comma separated strings");
2 // String of Vowels
3 string vowels = "A,E,I,O,U";
4 // Split vowels separated by a comma followed by space
5 string[] VowelList = vowels.Split(",");
6 foreach (string v in VowelsList)
7 Console.WriteLine(v);