Know If a String contains the same sequence in Java -


Right before that I want to know how often I can say "laziness" to the world string string 1 = "quick brown fox jumps on a celestial dog"; String String 2 = "lazy brown fox jumps on lazy dogs";

I know that two strings will work by using the Java string. Include, but how do I know that the first string in it is the word "lazy" and the second string 2 is "lazy" The word because it has a boolean method, so in this case I do not need it.

I want to know how to do this without the use of regesx, because I am learning how to create a Reggae engine.

It could actually use simple regex in one pass. Of course you can summarize it and make it systematic and streamlined.

  pattern p = Pattern.compile ("lazy"); Int events; Matcher M = P. Maternity (string 1); // etc while (m.find ()) occurences ++;    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -