Created
November 23, 2010 21:28
-
-
Save jordansissel/712575 to your computer and use it in GitHub Desktop.
backport String#start_with? to ruby 1.8.6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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