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"
String TestString = "12345678901234567890";
Int32 Count = (TestString).Length - (TestString.Replace("9", "")).Length;
Above i want to find the occurance of "9"
good one..
ReplyDeleteeasy and best approach