Answer the question
In order to leave comments, you need to log in
How can you truncate a string with commas in Ruby?
There used to be a site rubydev.ru, and there was almost everything about ruby, but right now there is no such thing.
Here, for example, there is a line: str='Область, город, улица'
How can you leave the text, cutting off the rest, which is up to the second comma, starting from the end ?
In our case, it should remain like this: str='city, street'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question