Method: String#after
- Defined in:
- lib/casual_support/string/after.rb
#after(delimiter) ⇒ String?
Searches for the first occurrence of delimiter
, and returns the portion of the String after that. If delimiter
is not found, returns nil. Equivalent to split(delimiter, 2).drop(1)[-1]
for non-empty delimiters.
15 16 17 18 |
# File 'lib/casual_support/string/after.rb', line 15 def after(delimiter) i = self.index(delimiter) i && self[i + delimiter.length, self.length] end |