Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace _14_LongestWordInText
- {
- class LongestWordInText
- {
- static void Main(string[] args)
- {
- string text = Console.ReadLine();
- string[] words = text.Split(new char[] {' ', '.', ',', '!', '"', }, StringSplitOptions.RemoveEmptyEntries);
- string longestWord=words.OrderByDescending(s => s.Length).First();
- Console.WriteLine(longestWord);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement