I have a string of varying length and is usually followed by white spaces (of varying length based on he string).
i.e. - the string is always 20 characters long
var data = "DUR IT R4356 " //with 8 trailing
or the string could be
var data = "11& 444 DTF# 5676 " //with 3 trailing
What is the best way to get rid of those trailing white spaces?
I was thinking some JS function that goes to the last character that is not a white space, then replace all the white spaces with empty string ?
Any suggestions? If jQuery is better for this I am open to that as well...
Thanks.