0

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?

suknic
  • 639
  • 6
  • 15
Rella
  • 62,177
  • 103
  • 350
  • 621
  • 2
    Possible 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
  • 1
    the 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

0 Answers0