Apex Count the number of occurences of a character(substring) in a string?

2:51 PM

string test='edwin.vijay.raymond';
system.debug('***'+test.countMatches('.'));

OUTPUT: 2

0 comments