Skip to content
On this page

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class · Ruby 3.0

String

< Object include Comparable 144 instance methods 2 class methods

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#[]=.

Class methods 2

Instance methods 144

Ruby version changes 1

  1. 3.0