substr1 자바스크립트 원하는 문자열 추출 (substring, substr ) 자바스크립트 원하는 문자열 추출 (substring, substr ) 1. substring String 문자열의 시작번호와 끝번호를 넘기면 그에 해당하는 부분 문자를 찾아 리턴한다. 사용 구문 str.substring(시작값, 끝값) 사용 예 ) var str = 'apple'; console.log( str.substring(0,2) ) ; // ap console.log( str.substring(1,3) ) ; // pp console.log( str.substring(2,4) ) ; // pl console.log( str.substring(0,5) ) ; // apple console.log( str.substring(99,100) ) ; // 빈값 console.log( str.substri.. 2022. 3. 16. 이전 1 다음