Ayo Softech

Friday 13 February 2015

count specific character in string Asp.Net

 
You could do this:
int count = test.Split('&').Length - 1;
 
Or with LINQ:
test.Count(x => x == '&');

1 comment: