'정처기' 카테고리의 다른 글
화면 설계 - UI 설계 (0) | 2024.06.13 |
---|---|
화면 설계 - UI 요구사항 확인 (0) | 2024.06.13 |
요구사항 확인 - 현행 시스템 분석 (0) | 2024.06.11 |
프로그래밍 언어 활용 - Java (0) | 2024.06.07 |
화면 설계 - UI 설계 (0) | 2024.06.13 |
---|---|
화면 설계 - UI 요구사항 확인 (0) | 2024.06.13 |
요구사항 확인 - 현행 시스템 분석 (0) | 2024.06.11 |
프로그래밍 언어 활용 - Java (0) | 2024.06.07 |
String myString = "ABAB"
String rpStr = myString.replace('A','X').replace('B','A').replace('X','B'); // A를 X로 치환, B를 A로 치환, X를 B로 치환
System.out.println(rpStr); // BABA
String str1 = "abcdefghijk";
System.out.println(str1.replaceAll("[abcghi]", "찬")); // 찬찬찬def찬찬찬jk
-> abcghi라는 값을 "찬"이라는 문자열로 변환
String str1 = "abcdefghijk";
System.out.println(str1.replaceAll("[^abcghi]","찬")); // abc찬찬찬ghi찬찬
-> 정규표현식에 "^"이 들어가면 abcghi를 제외한 모든 문자를 "찬"으로 변환
쿠키? 세션? 캐시? (0) | 2024.06.18 |
---|---|
웹 개발 시 익스플로러 주의! (0) | 2024.06.16 |
startsWith, endsWith, contains (0) | 2024.06.12 |
대문자, 소문자 변환 (0) | 2024.06.10 |
split() 함수로 문자열 자르기 (0) | 2024.06.09 |
데이터 입출력 구현 - 데이터 저장소 (0) | 2024.06.15 |
---|---|
화면 설계 - UI 요구사항 확인 (0) | 2024.06.13 |
요구사항 확인 - 현행 시스템 분석 (0) | 2024.06.11 |
프로그래밍 언어 활용 - Java (0) | 2024.06.07 |
데이터 입출력 구현 - 데이터 저장소 (0) | 2024.06.15 |
---|---|
화면 설계 - UI 설계 (0) | 2024.06.13 |
요구사항 확인 - 현행 시스템 분석 (0) | 2024.06.11 |
프로그래밍 언어 활용 - Java (0) | 2024.06.07 |
public static void main(String[] args){
String a = "123456";
System.out.println(a.startsWith("123")); // true
System.out.println(a.startsWith("23")); // false
System.out.println(a.startsWith(" 123")); // false
System.out.println(a.startsWith("123456")); // true
}
public static void main(String[] args) {
String a = "123456";
System.out.println(a.endsWith("456")); // true
System.out.println(a.endsWith("456 ")); // false
System.out.println(a.endsWith("123")); // false
System.out.println(a.endsWith("123456")); // true
}
public static void main(String[] args) {
String a = "123456";
System.out.println(a.contains("123")); // true
System.out.println(a.contains("4")); // true
System.out.println(a.contains("4 ")); // false
System.out.println(a.contains("1234")); // true
System.out.println(a.contains("123456")); // true
}
웹 개발 시 익스플로러 주의! (0) | 2024.06.16 |
---|---|
문자열 치환 (replace(), replaceAll()) (0) | 2024.06.14 |
대문자, 소문자 변환 (0) | 2024.06.10 |
split() 함수로 문자열 자르기 (0) | 2024.06.09 |
replace() / replaceAll() 사용법 (0) | 2024.06.09 |
데이터 입출력 구현 - 데이터 저장소 (0) | 2024.06.15 |
---|---|
화면 설계 - UI 설계 (0) | 2024.06.13 |
화면 설계 - UI 요구사항 확인 (0) | 2024.06.13 |
프로그래밍 언어 활용 - Java (0) | 2024.06.07 |
- 문자열을 모두 대문자로 바꾸어 변환해준다.
String str = "Upper Case";
str = str.toUpperCase();
System.out.println(str);
// UPPER CASE
- 문자열을 모두 소문자로 바꾸어 변환해준다.
String str = "Lower Case";
str = str.toLowerCase();
System.out.println(str);
// lower case
public String solution(string str) {
String anwer = "";
for(char x : str.toCharArray()){
if(character.isLowerCase(x)){
answer += Character.toUpperCase(x);
} else {
answer += Character.toLowerCase(x);
}
}
return answer;
}
소문자와 대문자의 아스키 코드의 차이는 32
A-65 / Z-90 / a-97 / z-122
65 <= char <= 90 은 대문자, 97 <= char <= 122은 소문자이다.
public String solution(String str){
String answer = "";
for(char x : str.toCharArray()){
if(x >= 97 && x <= 122) {
answer += (char)(x-32);
}else if(x >= 65 && x <= 90) {
answer += (char)(x+32);
}
}
return answer;
}
문자열 치환 (replace(), replaceAll()) (0) | 2024.06.14 |
---|---|
startsWith, endsWith, contains (0) | 2024.06.12 |
split() 함수로 문자열 자르기 (0) | 2024.06.09 |
replace() / replaceAll() 사용법 (0) | 2024.06.09 |
Integer.parseInt() (0) | 2024.06.09 |
startsWith, endsWith, contains (0) | 2024.06.12 |
---|---|
대문자, 소문자 변환 (0) | 2024.06.10 |
replace() / replaceAll() 사용법 (0) | 2024.06.09 |
Integer.parseInt() (0) | 2024.06.09 |
배열(Array) 정렬하기 (0) | 2024.06.09 |