From: "Florian Groß" Date: 2005-09-24T10:23:43+09:00 Subject: Re: trimming strings jotto wrote: > I want to trim the string for the text that comes with each entry in > the database. Ideally I want to trim it where it first finds
. I > imagine I use a loop to count how many characters I get to before it > finds
? Then I use some function (a function I can't find) that > trims the string to the desired amount of characters. Try this: str[0 ... str.index("
")] You probably do it more efficiently with Regexps, but that involves getting the multi-line flag right. Oh, or this: str.split("
").first