String - mfichman/jogo GitHub Wiki
Represents an immutable character string. New strings can be created via a substring or concatenation operation on an existing string.
@index(index Int) Char
Returns the character at index index. If the index refers to a location beyond the length of the string, then
@add(string String) String
Concatenates this string with 'string'.
@equal(string String) Bool
Returns true if this string is equal to 'string'.
@less(string String) Bool
Returns true if this string is lexically less than 'string'.
length?() Int
Returns the length of the string.
slice(begin Int, end Int) String
Returns a new string containing the elements starting at 'begin' and ending at the character before 'end'.
prefix(end Int) String
Returns a new string containing elements starting at the beginning of the string and ending at the character before 'end'.
suffix(begin Int) String
Return a new string containing elements starting at 'begin' and continuing to the end of this string.
starts_with(string String) Bool
Returns true if this string starts with the exact string specified by 'string'
ends_with(string String) Bool
Returns true if this string ends with the exact string specified by 'string'
uppercase?() String
Returns an uppercase version of this string.
lowercase?() String
Returns a lowercase version of this string.
str?() String
int?() Int
Converts the string into an integer. If the string is not a valid number, then zero is returned.
float?() Float
Converts the float into an integer. If the float is not a valid number, then zero is returned.
char?() Char
Converts the string to a character by returning the first character in the string.
hash?() Int
Returns the hash code for this string.
iter() StringIter
Returns an iterator over the characters in this string
@destroy()
No comment
@init()
No comment