Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
を使用して、別の文字列内の部分文字列の位置を見つけようとしていますIgnoreCase。 例:
IgnoreCase
String str ="aabbssddaa", str2="ab"; str.indexOf(str2);
大文字と小文字を区別しない str2 の位置を見つけたい。str2= いずれか "ab","Ab","aB","AB" を意味 し、文字列を一度だけトラバースしたい。
最も簡単な方法は、両方の文字列に対してtoLowerCase()orを使用することです。toUpperCase()
toLowerCase()
toUpperCase()