From: Ryan Pavlik Date: 2003-09-13T06:15:54+09:00 Subject: Re: String#start_with? / #end_with? On Sat, 13 Sep 2003 06:07:24 +0900 Philip Mak wrote: > Is there a built-in method in Ruby for checking whether a string starts > with or ends with a pattern? e.g.: > > "Hello, world".start_with?("Hello") => true > "Hello, world".start_with?("world") => false > Like this? ;-) "Hello world".match /^Hello/ # => MatchData "Hello world".match /^world/ # => nil -- Ryan Pavlik "Must use last ounce of strength to stab from beyond the grave." - 8BT