Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/toga/extensions.rb
Instance Method Summary collapse
Instance Method Details
#starts_with?(prefix, options = {}) ⇒ Boolean
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/toga/extensions.rb', line 4 def starts_with?(prefix, ={}) if prefix.is_a? Array prefix.each do |p| return true if self.starts_with?(p) end end prefix = prefix.to_s left = self[0, prefix.length] right = prefix return left.downcase == right.downcase if [:case_sensitive] == false left == right end |