Type:
Class

Rake extension methods for String.

A String object holds and manipulates an arbitrary sequence of bytes, typically representing characters. String objects may be created using String::new or as literals.

Because of aliasing issues, users of strings should be aware of the methods that modify the contents of a String object. Typically, methods with names ending in “!'' modify their receiver, while those without a “!'' return a new String. However, there are exceptions, such as String#[]=.

chomp
  • References/Ruby on Rails/Ruby/Classes/String

str.chomp(separator=$/) â new_str Instance Public methods Returns a new String

2025-01-10 15:47:30
unpack
  • References/Ruby on Rails/Ruby/Classes/String

str.unpack(format) â anArray Instance Public methods Decodes str

2025-01-10 15:47:30
[]
  • References/Ruby on Rails/Ruby/Classes/String

str[index] â new_str or nilstr[start, length] â new_str or nilstr[range] â new_str or nilstr[regexp]

2025-01-10 15:47:30
next!
  • References/Ruby on Rails/Ruby/Classes/String

str.next! â str Instance Public methods Equivalent to String#succ

2025-01-10 15:47:30
try_convert
  • References/Ruby on Rails/Ruby/Classes/String

String.try_convert(obj) â string or nil Class Public methods Try to convert

2025-01-10 15:47:30
strip
  • References/Ruby on Rails/Ruby/Classes/String

str.strip â new_str Instance Public methods Returns a copy of str

2025-01-10 15:47:30
chop!
  • References/Ruby on Rails/Ruby/Classes/String

str.chop! â str or nil Instance Public methods Processes str as

2025-01-10 15:47:30
center
  • References/Ruby on Rails/Ruby/Classes/String

str.center(width, padstr=' ') â new_str Instance Public methods Centers str

2025-01-10 15:47:30
swapcase
  • References/Ruby on Rails/Ruby/Classes/String

str.swapcase â new_str Instance Public methods Returns a copy of str

2025-01-10 15:47:30