From: Dave Benjamin Date: 2003-11-19T08:52:18+09:00 Subject: String startswith/endswith in Ruby? Hi all, 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. For instance: s = 'Hello, world!' s.startswith('Hello') >> true s.endswith('!') >> true s.endswith('asdf') >> false I'd like to avoid having to calculate the length of the string I'm searching for; I'd prefer not to have to write "s[0..4] == 'Hello'" or similar. Thanks! 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 :