java - Alphabetical value -


The string "code" appears anywhere in the string, return the number of times, for 'D' Any letter will accept, therefore "counting" and "ku" count

Use a regex:

  string.matches ("Co [az] e")   

To calculate the number of matches:

  int count = 0; Matcher m = Pattern.compile ("with [a-z] e"). Mattress (string); While (m.find ()) {count ++; }    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -