Filter upper case characters in CSharp
Description
The following code shows how to filter upper case characters.
Example
//ww w .ja va2s. c om
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
class Program
{
static void Main(string[] args)
{
String aString = "tHis Is a test";
IEnumerable<char> query = from ch in aString where Char.IsUpper(ch) select ch;
foreach(var c in query){
Console.WriteLine(c);
}
}
}
The code above generates the following result.