Wednesday, 12 December 2012

Count specific character occurances in string withou looping

To find the occurance of particular character without looping:

String TestString = "12345678901234567890";
Int32 Count = (TestString).Length - (TestString.Replace("9", "")).Length;


Above i want to find the occurance of "9"

1 comment: