Translator
Categories
Archives

Get Character Length of a String with JavaScript

Occasionally I run across the need to get the number of characters in a string. You can use the code below to determine the character length of a string.

var myString = 'This is a String';
alert(myString.length);

Leave a Reply