I think that's about it. You might want a version that lets you pass in the character to remove so you could trim trailing zeros or asterisks or whatever. trim() removes all whitespace, not just blanks. Don't know if you want to do that or not.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi