72
rated 0 times
[
74]
[
2]
/ answers: 1 / hits: 32869
/ 12 Years ago, tue, july 3, 2012, 12:00:00
I have a string like that:
var str = 'aaaaaa, bbbbbb, ccccc, ddddddd, eeeeee ';
My goal is to delete the last space in the string. I would use,
str.split(0,1);
But if there is no space after the last character in the string, this will delete the last character of the string instead.
I would like to use
str.replace(regex,'');
I am beginner in RegEx, any help is appreciated.
Thank you very much.
More From » regex