Skip to content
This repository was archived by the owner on Jun 29, 2023. It is now read-only.

String Methods

Se Chung edited this page Apr 18, 2018 · 3 revisions

String Methods

String.prototype.slice()

문자열을 잘라내는 메소드이다. 기본형은 str.slice(beginIndex[, endIndex]), 리턴값은 새 문자열이다.

'String'.slice(0, 2); // 'St'
beginIndex endIndex
음수일 경우 str.length + beginIndex로 취급 str.length + endIndex로 취급
str.length와 같거나 클 경우 빈 문자열을 반환 str.length와 같은 결과

Clone this wiki locally