- 사용 언어 : C++
String str2("abcb");
String str3(" aB c ");
String str4(str); - 완료
함수 | 예 | 완수 여부 |
charAt | str.charAt(3) == 'd' | |
compareTo | str2.compareTo("abcb") == 0 | |
compareToIgnoreCase | str2.compareTo("AbCb") == 0 | |
concat | str.concat(str) == "abcdefabcdef" | |
contains | str.contains("bcd") == TRUE | |
endsWith | str.endsWith("ef") == TRUE | |
startsWith | str.startsWith("abc") == TRUE | |
equals | str.equals(new String("abcdef")) == TRUE | 완료 |
equalsIgnoreCase | str.equalsIgnoreCase(new String("ABcdEf")) == TRUE | |
indexOf | str2.indexOf("b") == 1 | |
isEmpty | str.isEmpty == FALSE | 완료 |
lastIndexOf | str2.lastIndexOf("b") == 3 | |
length | str.length() == 6 | 완료 |
replace | str.replace("bc", "ad") == "aaddef" | |
split | str.split("c") == {"ab", "def"} | |
subString | str.subString(2, 4) == "cd" | 완료 |
format | String::format("참석자 : %d명", 8) == "참석자 : 8명" | |
trim | str3.trim() == "aB c" | |
toLower | str3.toLower() == " ab c " | |
toUpper | str.toUpper() == "ABCDEF" | |
valueOf | String::valueOf(3) == "3" |