Pages

Showing posts with label ingore case. Show all posts
Showing posts with label ingore case. Show all posts

Thursday, September 26, 2013

Split string, ignoring Case,ignoring blank values and Select Distinct split values



String str = "ankit,Ankit,ankit, , ,aNkit,rahul";

here, we have to split above string  by ','


var split_values = str.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Distinct(StringComparer.CurrentCultureIgnoreCase); 



You will get :

ankit
rahul