Finding second occurrence of a substring in a string in Java

前端 未结 5 1842
孤城傲影
孤城傲影 2020-12-01 06:16

We are given a string, say, \"itiswhatitis\" and a substring, say, \"is\". I need to find the index of \'i\' when the string \"i

5条回答
  •  庸人自扰
    2020-12-01 06:41

    I am using: Apache Commons Lang: StringUtils.ordinalIndexOf()

    StringUtils.ordinalIndexOf("Java Language", "a", 2)
    

提交回复
热议问题