KDT TIL Note/JS

JS 표준 내장 객체 - String 메서드

메리뉴데이 2022. 10. 28. 15:06

String 

 

 

 

.charCodeAt() / String.fromCharCode(아스키번호)

 

 

 

 

 

 

 

 

 

.includes(str)

 

 

 

 

 

 

 

 

 

.indexOf(str)

 

 

 

 

 

 

 

 

 

.match(RegExp)

 

 

 

 

 

 

 

 

 

.padStart() / .padEnd()

 

 

 

 

 

 

 

 

 

.replace()

 

 

 

 

 

 

 

 

 

.slice(시작 인덱스, 끝 부분의 다음 인덱스)

 

 

 

 

 

 

 

 

 

.split('구분자') / .join('구분자')

 

 

 

 

 

 

 

 

.startsWith()

 

 

 

 

 

 

 

 

 

.substring(begin index) / .substring(begin index, end index)

 

 

 

 

 

 

 

 

 

toUpperCase() / toLowerCase()

 

 

 

 

 

 

 

 

 

.trim()

 

 

 

.