How to use `string.startsWith()` method ignoring the case?

后端 未结 8 644
暖寄归人
暖寄归人 2020-12-14 05:13

I want to use string.startsWith() method but ignoring the case.

Suppose I have String \"Session\" and I use startsWith on \"sE

8条回答
  •  执笔经年
    2020-12-14 05:51

    You can use someString.toUpperCase().startsWith(someOtherString.toUpperCase())

提交回复
热议问题