1 개요[ | ]
- JavaScript 문자열 split()
JavaScript
Copy
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."]
▶ | fox |
▶ | k |
▶ | ["The quick brown fox jumps over the lazy dog."] |
2 같이 보기[ | ]
3 참고[ | ]
편집자 Jmnote
로그인하시면 댓글을 쓸 수 있습니다.