반응형
class Main {
public static void main(String[] args) {
String str1 = "Hello world";
String str2 = "어서오세요.";
String temp1 = str1.concat(str2); // 문자열 병합
String temp2 = str1.substring(0, 5); // 문자열 분활
System.out.printf("concat 사용 : %s\n", temp1);
System.out.printf("substring 사용 : %s\n", temp2);
}
}
반응형
'프로그래밍 > 자바, JDBC' 카테고리의 다른 글
자바 문자열, int형 길이(자릿수) 구하기 (0) | 2020.04.27 |
---|---|
특정 문자열 포함여부 확인(contatins) (0) | 2020.04.23 |
문자열 비교(equals) (0) | 2020.04.23 |
for ~ each문 (향상된 for문) (0) | 2020.04.23 |
메서드 오버라이드(재 정의) (0) | 2020.04.22 |