JAVA
equalsIgnoreCase
Initsave
2023. 9. 12. 23:37
java.lang.string 클래스
비교할때 대소문자 구분 없다
반환값 true/false
equalsIgnoreCase(String anotherString)
Compares this String to another String, ignoring case considerations.
|
대소문자 고려 사항을 무시하고 이 문자열을 다른 문자열과 비교합니다.
public boolean equalsIgnoreCase(String anotherString) {
return (this == anotherString) ? true
: (anotherString != null)
&& (anotherString.length() == length())
&& regionMatches(true, 0, anotherString, 0, length());
}