Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

String#to_s

() -> ::String
to_s → self or string

Returns self if self is a String, or self converted to a String if self is a subclass of String.

See also #to_r #to_str #to_i #to_sym also in 4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0