From: Dave Benjamin Date: 2003-11-19T09:37:18+09:00 Subject: Re: String startswith/endswith in Ruby? In article <6jclrv0c35l2tcq6n968lpao29trqn0sr6@4ax.com>, gabriele renzi wrote: > il Tue, 18 Nov 2003 23:45:43 -0000, Dave Benjamin > ha scritto:: > >>I'm a Python user trying to learn a bit of Ruby. I was wondering if there's >>a common way of writing "startswith" and "endswith" expressions for strings >>in Ruby. > > http://extensions.rubyforge.org/rdoc/classes/String.html > > then click on starts_with and ends_with and you'll see the code. Perfect, thanks! > BTW had'nt matz accepted to add these methods to the standard String > class? Beats me, but it'd be a nice addition. Thanks everyone for the quick replies. I hadn't thought of using regexes, though they do seem like overkill for this sort of problem. Anyway, I asked what people commonly do, and I got my answer. =) Peace, Dave -- ..:[ dave benjamin (ramenboy) -:- www.ramenfest.com -:- www.3dex.com ]:. : d r i n k i n g l i f e o u t o f t h e c o n t a i n e r :