string
Represents a sequence of characters.
Constructors
string() -> string
Creates a default-constructed instance of string.
string(const Number number) -> string
Converts a number to its string representation.
Parameters
- number: The number to convert to string.
string(const CSVDocument value) -> string
Returns a standardized string representation for a CSVDocument.
Parameters
- value: The value to convert to string.
string(const complex value) -> string
Converts a value to its string representation.
Parameters
- value: The value to convert to a string.
string(bool b) -> string
Converts a boolean value to its string representation.
Parameters
- b: The boolean value to convert.
Returns
The string representation of the boolean value ('true' or 'false').
string(const Slice value) -> string
Returns a standardized string representation for a Slice.
Parameters
- value: The value to convert to string.
string(const TimerDuration duration) -> string
Converts the duration to a human-readable string with appropriate units.
Parameters
- duration: The duration to convert to string.
string(const string other) -> string
Creates a copy of an existing string object.
Parameters
- other: The string object to copy.
string(const BenchmarkResult value) -> string
Returns a standardized string representation for a BenchmarkResult.
Parameters
- value: The value to convert to string.
string(const Timer value) -> string
Returns a standardized string representation for a Timer.
Parameters
- value: The value to convert to string.
Symbols
| Name | Description |
|---|---|
!= | Performs inequality comparison operation. |
+ | Performs addition operation. |
+= | Performs addition assignment operation. |
< | Performs less than comparison operation. |
<= | Performs less than or equal comparison operation. |
= | Assigns the value of the right-hand side to the left-hand side. |
== | Performs equality comparison operation. |
> | Performs greater than comparison operation. |
>= | Performs greater than or equal comparison operation. |
[] | Accesses characters using slice notation (Python-style). |
Members
| Name | Description |
|---|---|
| back | Returns the last element in the container. Throws an exception if the container is empty. |
| capacity | Returns the number of elements that the container has currently allocated space for. |
| capitalize | Return a capitalized version of the string. |
| clear | Clears all elements from the container. |
| contains | Checks if a string contains the given string. |
| count | Returns the number of occurrences of the specified value in the container. |
| empty | Checks if the container is empty. |
| ends_with | Checks if a string ends with the given string. |
| erase | Removes the first occurrence of the specified value from the container. |
| erase_at | Erases the element at the specified position in the container. |
| extend | Extends the string by appending all elements from another string. |
| find_first_not_of | Finds the first occurrence of any character not in the specified substring starting from the given position. |
| find_first_of | Finds the first occurrence of any character from the specified substring starting from the given position. |
| find_last_not_of | Finds the last occurrence of any character not in the specified substring starting from the given position. |
| find_last_of | Finds the last occurrence of any character from the specified substring starting from the given position. |
| front | Returns the first character in the string. Throws an exception if the string is empty. |
| index | Returns the index of the first occurrence of the specified value in the container. |
| insert_at | Inserts an element at the specified position in the container. |
| is_alpha | Checks if the string consists only of alphabetic characters. |
| is_digit | Checks if the string consists only of digits. |
| is_sorted | Checks if the container is sorted in increasing order (comparison operator<). |
| pop_back | Removes the last element from the container. Throws an exception if the container is empty. |
| push_back | Appends an element to the end of the container. |
| replace | Replaces all occurrences of a string within the given string. |
| replaced | Replaces all occurrences of a string within the given string. |
| replicate | Replicates the container n times. |
| replicated | Creates a new container by replicating the original container n times. |
| reserve | Reserves storage for at least the specified number of elements. |
| resize | Resizes the container to contain the specified number of elements. |
| reverse | Reverses the order of elements in the container. Returns the container itself. |
| reversed | Returns a reversed copy of the the container. |
| size | Returns the number of elements in the container. |
| sort | Sorts the container in place using the provided comparison function and returns the sorted container. |
| sorted | Returns a sorted copy of the container. |
| split | Splits the given string into a list of strings. |
| starts_with | Checks if a string starts with the given string. |
| substr | Returns a substring starting at the specified position with the specified length. |
| to_lowercase | Convert the given string to lowercase letters. |
| to_uppercase | Convert the given string to uppercase letters. |
| trim | Trims the given string. |
| trim_end | Trims the end of the given string. |
| trim_start | Trims the beginning of the given string. |