using System;
using System.Linq;
public class Program
{
public static string FindSecondLargestWordInString(string s) {
string secondLongest = s.Split(" ")
.OrderByDescending(x => x.Length)
.Skip(1)
.FirstOrDefault();
return secondLongest;
}
public static void Main(string[] args)
{
string s = "c cpp cobol c# python java";
string secondLongest = FindSecondLargestWordInString(s);
if (secondLongest != null) {
Console.WriteLine("The second longest word is: " + secondLongest);
}
else {
Console.WriteLine("No second longest word found.");
}
}
}
/*
run:
The second longest word is: cobol
*/