Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • @RoelDelosReyes You're welcome. Don't forget to up vote and mark as the answer. Commented Feb 25, 2018 at 18:15
  • if space is at end of string? Commented Feb 25, 2018 at 18:18
  • @JayShankarGupta not needed i can do it with just trim() but man it is quite annoying with extra spaces between strings Commented Feb 25, 2018 at 18:19
  • @JayShankarGupta What if the space is at the end? The regular expression used finds all extra space no matter where it is. Commented Feb 25, 2018 at 18:38