class String
Extends Ruby’s own String
class with method start_with?
for Ruby < 1.8.7
@author Sebastian Staudt @since 0.3.0
Public Instance Methods
start_with?(start)
click to toggle source
Returns true if this string starts with the given substring
@param [String] start The substring to check @return [Boolean] true
if this String
starts with the given substring
# File lib/core_ext/string.rb, line 18 def start_with?(start) !/^#{start}/.match(self).nil? end