java - Alphabetical value -
java - Alphabetical value -
return number of times string "code" appears anywhere in given string, except we'll take letter 'd', "cope" , "cooe" count.
is there value can input means letter or have create case every letter of alphabet?
use regex:
string.matches("co[a-z]e") to count number of matches:
int count = 0; matcher m = pattern.compile("co[a-z]e").matcher(string); while(m.find()) { count++; } java string letters
Comments
Post a Comment