Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class SortWords
- {
- static void Main()
- {
- string str = "Write a program that reads a list of words, separated by spaces and prints the list in an alphabetical order.";
- string[] words = str.Split(new char[] { ' ', ',', '.' }, StringSplitOptions.RemoveEmptyEntries);
- Array.Sort(words);
- foreach (var word in words)
- {
- Console.WriteLine(word);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement