About 480,000 results
Open links in new tab
  1. javascript - How do you get the length of a string using jQuery ...

    Jun 25, 2009 · UTF-16, the string format used by JavaScript, uses a single 16-bit code unit to represent the most common characters, but needs to use two code units for less commonly-used characters, …

  2. How to check string length with JavaScript - Stack Overflow

    Dec 8, 2013 · I want to get the string length when a key is pressed like StackOverflow does. I have tried to do this with onblur, but it's not working. How do I do this?

  3. Isn't string.length actually a method in JavaScript?

    Jul 16, 2021 · It's easy to think of strings in Javascript as mutable and as such length should be a method, but when you do var a = 'hello'; a += ' hello'; it looks like you can mutate a string, but what's …

  4. How does String.length work in JavaScript? - Stack Overflow

    I want to know how is the string length of a string calculated in js. Is is a function call or a class data member. I want to know what happens when we execute the following code : a = 'this is a ...

  5. How to trim a string to N chars in Javascript? - Stack Overflow

    How can I, using Javascript, make a function that will trim string passed as argument, to a specified length, also passed as argument. For example: var string = "this is a string"; var length = 6;...

  6. javascript - Understanding the .length property - Stack Overflow

    Dec 1, 2019 · JavaScript exhibits zero based indexing, that is, the first element in an array or in a string is at position 0. Therefore, an array or string of length n has elements going from position 0 to n - 1, …

  7. unicode - String length in bytes in JavaScript - Stack Overflow

    String length in bytes in JavaScript Asked 14 years, 8 months ago Modified 1 year, 5 months ago Viewed 210k times

  8. Character limit of a javascript string variable - Stack Overflow

    Dec 4, 2012 · 31 Can JavaScript string store 100K characters? I've written a script where a string from PHP is passed to a variable in JavaScript. It works fine when it is cut short to almost ten thousand …

  9. javascript - Generate a string of random characters - Stack Overflow

    I want a string of fixed length, composed of characters picked randomly from a set of characters e.g. [a-zA-Z0-9]. How can I do this with JavaScript?

  10. javascript testing .length and .length > 0 - Stack Overflow

    MyObject.SomeText.length asks "does this string have a length property"? It relies on extra knowledge that JavaScript implicitly does the same check as the previous.