java - How to count the number of pairs in a string -


if enter string "in win". how go having program finding pairs "in" in string. there two. know find occurrences of 1 character in string, how pair.

thank you.

use countmatches method of apache commons stringutils class (http://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/stringutils.html).

stringutils.countmatches("in win", "in"); 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -