[ruby] How to get a substring of text?