Skip to content

Instantly share code, notes, and snippets.

@jordansissel
Created November 23, 2010 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jordansissel/712575 to your computer and use it in GitHub Desktop.
Save jordansissel/712575 to your computer and use it in GitHub Desktop.
backport String#start_with? to ruby 1.8.6
if !String.instance_methods.include?("start_with?")
class String
def start_with?(str)
return self[0 .. (str.length-1)] == str
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment