Trim any character from the ends of the String in JavaScript
May 28, 2023Javascript provides a method on string objects to trim off spaces from the end. But there are times when you want to trim any character from the ends of the string. You can easily create this functionality in Javascript by creating a new custom trim method.