Class: String
Overview
Extends Ruby’s own String class with method #start_with? for Ruby < 1.8.7
Instance Method Summary collapse
-
#start_with?(start) ⇒ Boolean
Returns true if this string starts with the given substring.
Instance Method Details
#start_with?(start) ⇒ Boolean
Returns true if this string starts with the given substring
18 19 20 |
# File 'lib/core_ext/string.rb', line 18 def start_with?(start) !/^#{start}/.match(self).nil? end |