strlen() Analog in Javascript

Hi everybody,

yesterday I was asked what’s the analog of strlen() PHP function in Javascript.
Well, actually it’s supersimple:

var str = "Hello World!";
alert(str.length);

And that’s it. String’s property “length” is how to get length of string in Javascript.

Books to read

One Comment

  1. Levi Kluka

    Hi there just wanted to give you a quick heads up. The text in your content seem to be running off the screen in Safari. I’m not sure if this is a formatting issue or something to do with web browser compatibility but I thought I’d post to let you know. The design look great though! Hope you get the issue solved soon. Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *