public static void Main()
string input = "My Name is Safar Mansuri mansuri safarre";
while (end <= input.Length)
if (end == input.Length || char.IsWhiteSpace(input[end]))
string word = input.Substring(start, end - start);
if (word.Length > longestWord.Length)
Console.WriteLine("The longest word is: " + longestWord);