How do you get the length of a string?

javascript, jquery, string-length

Solution

You don't need jquery, just use `yourstring.length`. See reference here and also here.

Update:

To support unicode strings, length need to be computed as following:

[...""].length

or create an auxiliary function

function uniLen(s) {
    return [...s].length
}

Problem

How do you get the length of a string in jQuery?

Original source