시작하는 값확인, 끝부분, 포함값 확인
let str = 'hello world ! ^^ ~~'; let matchstrStart = 'hello'; let matchstr = '^ ~~'; console.log(str.startsWith(matchstrStart)); console.log(str.endsWith(matchstr)); console.log(str.includes('^^'));
startsWith : 시작하는지 true/false반환endsWith : 끝나는지 true/false반환includes : 포함하는지 true/false반환
댓글
댓글 쓰기