JavaScript 문자열 split()

Jmnote (토론 | 기여)님의 2023년 9월 18일 (월) 08:40 판 (새 문서: ==개요== ;JavaScript 문자열 split() <syntaxhighlight lang='javascript' run> const str = 'The quick brown fox jumps over the lazy dog.'; const words = str.split(' '); console.lo...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요[ | ]

JavaScript 문자열 split()
const str = 'The quick brown fox jumps over the lazy dog.';

const words = str.split(' ');
console.log(words[3]); // fox

const chars = str.split('');
console.log(chars[8]); // k

const strCopy = str.split();
console.log(strCopy); // ["The quick brown fox jumps over the lazy dog."]

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}