더 나은 프로그래머가 되자

문자열 교체 replace 함수 사용 본문

언어/js

문자열 교체 replace 함수 사용

greathuman 2015. 4. 9. 15:31

var str = "test";
var new_str = str.replace("test","replace string!"); // replace("교체대상문자","교체될문자")
document.write(new_str);

결과값 : replace string!
Comments