How do I remove a substring after a certain character in a string using Ruby?
new_str = str.slice(0..(str.index('blah')))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With