JAVA/Java 기초

문자열

  split(String regex)
  - split 메소드는 문자열을 특정 구분자로 분리하는 메소드이다.
  - Splits this string around matches of the given regular expression.
   
  substring(int beginIndex, int endIndex)
  - substring은 문자열 중 특정 부분을 뽑아낼 경우에 사용한다
  - Returns a string that is a substring of this string.
   
  replace(char oldChar, char newChar)
  - 문자열 대체
  - Returns a string resulting from replacing all occurrences of oldChar 
    in this string with newChar.
   
  concat(String str)
  - 문자열 연결
  - Concatenates the specified string to the end of this string. 
   
  length()
  - 문자열 길이
  - Returns the length of this string.
   
  compareTo(String anotherString)
  - 두 문자열을 비교
  - Compares two strings lexicographically.

 

 

 

728x90
728x90

'JAVA > Java 기초' 카테고리의 다른 글

함수  (0) 2022.05.15
반복문과 배열 연습  (0) 2022.05.14
2차원 배열  (0) 2022.05.13
배열 연습 1  (1) 2022.05.13
배열(Array)  (0) 2022.05.12