Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js remove english word from string

string2 = "I love you 我爱你"
englishChars = string2.replace(/[^a-z ]/ig, "").trim().split(/s+/);
nonEnglishChars = string2.replace(/[a-z ]/ig, "").split(/[ ]*/);
final = englishChars.concat(nonEnglishChars);
console.log(final);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #remove #english #word #string
ADD COMMENT
Topic
Name
4+5 =