Javascript Regular Expressions: space count

Posted by Jimmy on Stack Overflow See other posts from Stack Overflow or by Jimmy
Published on 2010-04-25T05:18:08Z Indexed on 2010/04/25 5:23 UTC
Read the original article Hit count: 271

Hi,

Lets say I have a string " Hello World"

How can I use a regular expression to return the number of spaces I have in the string. In this case it would be '2'.

Thanks

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about regular-expression