We have a large string. We want to iterate through it word by word. But we also want to notice special characters and special character combinations (such as //
and new line). How to do such thing in javascript with jquery?
Asked
Active
Viewed 1,794 times
0
-
2Possible duplicate of [Lexer written in Javascript?](http://stackoverflow.com/questions/1823612/lexer-written-in-javascript) – Frédéric Hamidi Oct 19 '11 at 12:17
-
1the easiest I can think of is var str = string.split(" "); $(str).each(function(){ if(this == "\\\\") do something; }); – U.P Oct 19 '11 at 12:42