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

后端 未结 8 674
暖寄归人
暖寄归人 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:39

    try this,

    String session = "Session";
    if(session.toLowerCase().startsWith("sEsSi".toLowerCase()))
    

提交回复
热议问题