Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to get index of second occurrence java

String str = "itiswhatitis";
//returns the index of the first i in "is"
str.indexOf("is");
//returns the index of the second occurence of  i in "is" after the first 
str.indexOf("is", str.indexOf("is") + 1);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #index #occurrence #java
ADD COMMENT
Topic
Name
4+5 =