About 52 results
Open links in new tab
  1. Trim string in JavaScript - Stack Overflow

    Jan 31, 2009 · Explanation: The function trim () accept a string object and remove any starting and trailing whitespaces (spaces,tabs and newlines) and return the trimmed string.

  2. Trim spaces from start and end of string - Stack Overflow

    223 Note: As of 2015, all major browsers (including IE>=9) support String.prototype.trim (). This means that for most use cases simply doing str.trim() is the best way of achieving what the question asks. …

  3. trim - String strip () for JavaScript? - Stack Overflow

    Jun 11, 2022 · How do I strip leading and trailing spaces from a string? For example, " dog " should become "dog".

  4. How to trim specific characters from the end of the JavaScript string ...

    In JavaScript, how do I trim from the right (string end)? I have the following example:

  5. Remove whitespaces inside a string in javascript

    May 29, 2012 · 209 I've read this question about javascript trim, with a regex answer. Then I expect trim to remove the inner space between Hello and World.

  6. javascript - How to trim () white spaces from a string? - Stack Overflow

    JavaScript doesn't seem to have a native trim() method. How can I trim white spaces at the start and end of a string with JavaScript?

  7. How do I chop/slice/trim off last character in string using Javascript ...

    How do I chop/slice/trim off last character in string using Javascript? Asked 16 years, 8 months ago Modified 1 year ago Viewed 2.6m times

  8. javascript - Remove ALL white spaces from text - Stack Overflow

    This is a snippet from my code. I want to add a class to an ID after getting another ID's text property. The problem with this, is the ID holding the text I need, contains gaps between the letters. I would …

  9. Remove all white space from string JavaScript - Stack Overflow

    var str = " abc de fog "; str.trim(); Gives abc de fog AND NOT abcdefog, which I want. How can I get all the white space removed using JavaScript?

  10. How to remove the first and last slash - Stack Overflow

    CorPao 1,312 2 8 11 1 Related: Trim only the first and last occurrence of a character in a string (PHP) – Daniel Vandersluis Oct 1, 2010 at 15:34