Is there a way to remove a specific instance of an item from a string? For example, if I have the string:
"kiwi, durian, and, starfruit"
how can I remove the final comma only? I need a solution that will remove the last comma from the string no matter how many items the string contains.
Couldn't find anything at all on this by Googling around (at least not for Ruby without Rails. If you're using Rails, it's easy--just use the array.to_sentence method.)