Hi,
I have a string:
"116,118,120,130"
and will want to delete either the first, last or any value in between upon execution.
To to this I was using:
"116,118,120,130".gsub('118','')
but the problem is the string contains an extra unnessesary comma:
"116,,120,130"
and if I use
"116,118,120,130".gsub(',116','')
it will remove the comma, but then won't match "116" in the string as there is no comma in front of "116"
How can I match parts of my string that may or my not have the comma in front of value I am removing elegantly?
Thanks,