Filtering Uppercase Words

Sandhyab
Posted by Sandhyab under ASP.NET category on | Points: 40 | Views : 803
static void Main(string[] args)
{

var words = FilteringWords("HELLO this IS an EXAMLPLE for LINQ upper CASE");
foreach (string str in words)
Console.WriteLine(str);
Console.ReadLine();
}

static IEnumerable<string> FilteringWords(string str)
{
var uppercase= str.Split(' ')
.Where(s => String.Equals(s, s.ToUpper(),
StringComparison.Ordinal));

return uppercase;

}

Comments or Responses

Login to post response