How to check if a String contains another String in a case insensitive manner in Java?

前端 未结 19 1455
渐次进展
渐次进展 2020-11-22 03:20

Say I have two strings,

String s1 = \"AbBaCca\";
String s2 = \"bac\";

I want to perform a check returning that s2 is contained

相关标签:
19条回答
  • 2020-11-22 04:26

    or you can use a simple approach and just convert the string's case to substring's case and then use contains method.

    0 讨论(0)
提交回复
热议问题