indexOf Case Sensitive?

后端 未结 19 1237
日久生厌
日久生厌 2020-11-27 19:39

Is the indexOf(String) method case sensitive? If so, is there a case insensitive version of it?

19条回答
  •  抹茶落季
    2020-11-27 19:58

    Converting both strings to lower-case is usually not a big deal but it would be slow if some of the strings is long. And if you do this in a loop then it would be really bad. For this reason, I would recommend indexOfIgnoreCase.

提交回复
热议问题