using System;
using System.Linq;
class Program
{
static int ShortestWordLength(string text) {
// Split on whitespace; remove empty entries
var words = text.Split((char[])null, StringSplitOptions.RemoveEmptyEntries);
if (words.Length == 0)
return 0;
return words.Min(w => w.Length);
}
static void Main()
{
string input = "Find the shortest word length in this string";
int result = ShortestWordLength(input);
if (result == 0)
Console.WriteLine("No words found.");
else
Console.WriteLine("Length of the shortest word: " + result);
}
}
/*
run:
Length of the shortest word: 2
*/