class

CharArray

Inherits Reference / Object

This is used as an alternative to String in cases where we need constant time random access and ranges of characters in the string.

Constructors

new(str : String)
Source

Instance methods

[](start_index : Int, count : Int) : String
Source
[](index : Int) : Char
Source
[](range : Range(Int32, Int32)) : String
Source
size
Source
to_s

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.

Source