indexOf Case Sensitive?

后端 未结 19 1232
日久生厌
日久生厌 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:55

    Yes, I am fairly sure it is. One method of working around that using the standard library would be:

    int index = str.toUpperCase().indexOf("FOO"); 
    

提交回复
热议问题