string
Source code
This file contains functions for manipulating strings
Index
string::drop-index
drops length characters from the string at index
Example
Arguments
- $1 (string): The string to drop characters from
- $2 (integer): The index to start dropping characters
- $3 (integer): The number of characters to drop
Output on stdout
- The string with characters dropped
string::random
Generate a random string. First character is always a letter.
Example
Arguments
- $1 (integer): [42] The length of the string
- $2 (string): [a-zA-Z0-9] The characters to use in the string
Output on stdout
- The random string
string::indent
Left trim all lines in a string
Example
Arguments
- $1 (string): The string to trim
- $2 (int): [0] Indent the string by this amount:w
Output on stdout
- The trimmed string
string::trim-left
Left trim a string
Example
Arguments
- $1 (string): The string to trim
- $2 (string): [ \n\t] The characters to trim
Output on stdout
- The trimmed string
string::trim-right
Right trim a string
Example
Arguments
- $1 (string): The string to trim
- $2 (string): [ \n\t] The characters to trim
Output on stdout
- The trimmed string
string::trim
Trim a string
Example
Arguments
- $1 (string): The string to trim
- $2 (string): [ \n\t] The characters to trim
Output on stdout
- The trimmed string
Was this section helpful?