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
  • 637
  • 6
  • 15
Rella
  • 65,003
  • 109
  • 363
  • 636
  • 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