본문 바로가기

html | javascript

html javascript - string split

const str0 = '123456789'
const str1 = '1,2,3,4,5,6,7,8,9'
const str2 = '1/2/3/4/5/6/7/8/9'
const split0 = str0.split('')
const split1 = str1.split(',')
const split2 = str2.split('/')
console.log(split0)
console.log(split1)
console.log(split2)
// ["1","2","3","4","5","6","7","8","9"]

'html | javascript' 카테고리의 다른 글

html javascript - array concat  (0) 2024.08.18
html javascript - string replace  (0) 2024.08.18
html javascript - array join  (0) 2024.08.18
html javascript - input txt file  (0) 2024.08.18
html javascript - clear canvas  (0) 2024.08.18