Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (4k points)
Is it possible to determine if a String str1="ABCDEFGHIJKLMNOP" contains a string pattern strptrn="gHi"? I wanted to know if that's possible when the characters are case insensitive. If so, how?

1 Answer

0 votes
by (46k points)

If you won't go with regex:

"ABCDEFGHIJKLMNOP".toLowerCase().contains("gHi".toLowerCase())

Related questions

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...