What is an acceptable way to remove a particular trailing character from a string?
For example if I had a string:
> "item,"
And I wanted to remove trailing ','s only if they were ','s?
Thanks!
What is an acceptable way to remove a particular trailing character from a string?
For example if I had a string:
> "item,"
And I wanted to remove trailing ','s only if they were ','s?
Thanks!
Use a simple regular expression:
A function to trim any trailing characters would be: