Counting number of digits or chars

I need to count how many chars or digits a variable contains so I can check if a variable contains ie. 02 or 020 . Thanks

Comments

  • : I need to count how many chars or digits a variable contains so I can check if a variable contains ie. 02 or 020 . Thanks
    :
    You could try the length property:

    var thisisavar = 400;
    alert(thisisavar.length);
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion