var text = "이것은 \n 텍스트입니다 \t.";Runtime:
텍스트 = text.replace(/ /g,'');
console.log(텍스트);
thisestun문자 g는 전체 문자열에 대한 검색 반복을 정의합니다. 이 정규식은 공백을 제거했지만 왼쪽 줄 바꿈과 \t.
text.
공백만 없애려면 \s 다음과 같습니다:
text = text.replace(/\s/g,'');Execution:
thisisuntext.
var text = "이것은 \n 텍스트입니다 \t.";Runtime:
텍스트 = text.replace(/ /g,'');
console.log(텍스트);
thisestun문자 g는 전체 문자열에 대한 검색 반복을 정의합니다. 이 정규식은 공백을 제거했지만 왼쪽 줄 바꿈과 \t.
text.
text = text.replace(/\s/g,'');Execution:
thisisuntext.
Commentaires (0)
Laisser un commentaire
Connectez-vous pour commenter
Rejoignez la discussion et partagez vos connaissances avec la communauté
Chargement des commentaires...