String
Functions
truncate32
Truncates a string to 32 bytes
function truncate32(string memory str_) internal pure returns (string memory);
substring
Returns a substring of a string
function substring(string memory str_, uint256 startIndex_, uint256 endIndex_)
internal
pure
returns (string memory);
Parameters
| Name | Type | Description |
|---|---|---|
str_ | string | The string to get the substring of |
startIndex_ | uint256 | The index to start the substring at |
endIndex_ | uint256 | The index to end the substring at |
Returns
| Name | Type | Description |
|---|---|---|
<none> | string | resultString The substring |
substringFrom
Returns a substring of a string from a given index
function substringFrom(string memory str_, uint256 startIndex_) internal pure returns (string memory);
Parameters
| Name | Type | Description |
|---|---|---|
str_ | string | The string to get the substring of |
startIndex_ | uint256 | The index to start the substring at |
Returns
| Name | Type | Description |
|---|---|---|
<none> | string | resultString The substring |
Errors
EndBeforeStartIndex
error EndBeforeStartIndex(uint256 startIndex, uint256 endIndex);
EndIndexOutOfBounds
error EndIndexOutOfBounds(uint256 endIndex, uint256 length);