Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- #Microservice
- 토익
- 감사
- #화면캡쳐 #macOS
- 2010
- 프로젝트 시작
- docker #docker tutorial
- Lambda
- java
- 분석 작업
- WebJar
- 방법론
- Spring Boot
- jv
- 평가인증
- Microservices
- #Gradle Multi project with IntelliJ
- #단축키
- #정규표현식
- 년말
- bootstrap
Archives
- Today
- Total
사랑해 마니마니
minsoo study 본문
String Char IndexOf
- String.indexOf(String str) //없는 경우 -1 Return
- String.indexOf(int ch)
- Stirng.indexOf(int ch, int fromIndex)
- String.indexOf(String str, int fromIndex)
- cf. String.lastIndexOf // 끝에서 부터 검색함
- char ch = String.charAt(int index)
String, Char Operation
- char[] charArray = string.toCharArray();
String Operation (Replace, Substring)
- String.replace(CharSequnce target, CharSequence replacement)
- String.replaceAll(String 정규표현식, String replacement) cf: 여러 문자 조합: |, escape: \\
- String.replaceFirst
- String.substring(beginIndex)
- String.substring(beginIndex, endIndex) //endIndex 앞까지 자름
- boolean boolean String.contains
StringBuilder 사용하기
- .append
- .toString
String CompareTo
Parsing하기
- String.split(String regex)
matches
자료 변환
- Integer integer = Integer.valueOf(int i)
- Integer integer = Integer.valueOf(String s)
- int integer = Integer.parseInt(String s); // try { } catch (NumberFormatException e) { }
숫자를 문자로
- String s = ""+integer;
Eliment 순서 바꾸기
- Collections.swap(list, index i, index j);
문자, 숫자 체크
try {
Integer.parseInt(s);
return true;
} catch (NumberFormatException e) {
return false;
}
- Character.isDigit(char c) // 만약 c에 integer값이 들어갈 경우 ascii값으로 환산하여 계산하여 true, false 반환
if(Pattern.matches("[1-9]", ""+ch));
List Sorting
cf 비교하기 string.compareTo(s) // 같으면 0, 크면 +1, 작으면 -1
Collections.sort(list, new Comparator<Student>() {
@Override
public int compare(Student s1, Student s2) {
if (s1.getScore() < s2.getScore()) {
return -1;
} else if (s1.getScore() > s2.getScore()) {
return 1;
}
return 0;
}
});
Recursive
public static int func(int n) {
if (n == 0)
return 0;
else
return n + func(n - 1);
}
Cube 90도 돌리기
- cube[cube.length-inx-1][jnx];
기타 idea
- Math.max(number1, number2);
- 갯수 구하기는 map으로
- 자릿수 구하기: int num = (int)(Math.log10.(inputData) +1);
문자 삭제하기
- List<Character> alphabets = letters.stream() .filter(Character::isAlphabetic) .collect(Collectors.toList());
- for (Iterator<Character> iter = letters.iterator(); iter.hasNext(); ) { Character letter = iter.next(); if (Character.isDigit(letter)) { iter.remove(); } }
대소문자 구분
- Character.isUpperCase(s)
- Character.isLowerCase(s)
- Character.isDigit(s)
Comments