java.lang.String.contains(CharSequence)
public boolean containsโ(CharSequence s)
๋งค๊ฐ๋ณ์ CharSequence :
CharSequence ๋ฌธ์์ด์ด ํฌํจ๋์ด์๋์ง ํ์ธ
๋ฐํ๊ฐ boolean :
ํฌํจ๋์ด์์ผ๋ฉด true, ํฌํจ๋์ด์์ง ์์ผ๋ฉด false
String.contains(str)
์์
public class ContainsEx {
public static void main(String[] args) {
String str1 = "ABCDEFG";
String str2 = "HIJKLMN";
System.out.println(str1.contains("ABC"));
System.out.println(str2.contains("ABC"));
}
}
์ถ๋ ฅ
true false |
์ฌ์ฉ ์ : nanarin.tistory.com/51