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

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -