Thursday, 5 September 2013

linq query does not return any number and special character

linq query does not return any number and special character

In the following query:
public List<string> GetFilterLink()
{
//List<string> result;
// char[] arr = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L', 'M', 'N', 'P', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z' };
using (var db = new OfficePlusEntities())
{
List<string> result = (from i in db.CON_CONTACT
where
(!string.IsNullOrEmpty(i.CON_FIRST_NAME))
&&
(!string.IsNullOrWhiteSpace(i.CON_FIRST_NAME))
select i.CON_FIRST_NAME.Trim().Substring(0,
1).ToUpper()).Distinct().ToList();
return result;
}
I want query result contain only letter A-Z, no any numbers and specials
characters.
Thanks in advance.

No comments:

Post a Comment