Module: At::String
- Included in:
- String
- Defined in:
- lib/mightystring/string_at.rb
Instance Method Summary collapse
-
#at(in_srch = nil) ⇒ Object
At : Returns string instead of char number.
- #delete_at(arg) ⇒ Object
- #values_at(*args) ⇒ Object
Instance Method Details
#at(in_srch = nil) ⇒ Object
At : Returns string instead of char number.
10 11 12 13 14 15 |
# File 'lib/mightystring/string_at.rb', line 10 def at(in_srch = nil) if in_srch.is_a?(Integer) return self[in_srch..in_srch] end return nil end |
#delete_at(arg) ⇒ Object
21 22 23 |
# File 'lib/mightystring/string_at.rb', line 21 def delete_at(arg) self.replace self[0...arg] + self[arg+1..-1] end |
#values_at(*args) ⇒ Object
17 18 19 |
# File 'lib/mightystring/string_at.rb', line 17 def values_at(*args) self.chars.values_at(*args).join end |