aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend/string.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/extend/string.rb')
-rw-r--r--Library/Homebrew/extend/string.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/extend/string.rb b/Library/Homebrew/extend/string.rb
index 632d8ae8a..1d9c2e036 100644
--- a/Library/Homebrew/extend/string.rb
+++ b/Library/Homebrew/extend/string.rb
@@ -21,6 +21,10 @@ class String
s = chomp
s unless s.empty?
end
+
+ def strip_prefix(prefix)
+ start_with?(prefix) ? self[prefix.length..-1] : self
+ end
end
class NilClass