string_utils
Source: functions.
Methods
chars(str) → Array of string
Splits a string into an array of characters
Parameter
Name | Type | Optional | Description |
---|---|---|---|
str |
string |
|
The string to split |
- Returns
-
Array of string
chcode(char) → number
Gets the ASCII code a character
Parameter
Name | Type | Optional | Description |
---|---|---|---|
char |
string |
|
The character to get the code of |
- Returns
-
number
csv(str) → Array of string
Splits a string on commas and trims each element
Parameter
Name | Type | Optional | Description |
---|---|---|---|
str |
string |
|
The string to split |
- Returns
-
Array of string
groups(str) → Array of string
Splits a string on "\n\n"
Parameter
Name | Type | Optional | Description |
---|---|---|---|
str |
string |
|
The string to split |
- Returns
-
Array of string
ints(str) → Array of number
Extracts all integers from a string and returns them in an array
Parameter
Name | Type | Optional | Description |
---|---|---|---|
str |
string |
|
The string to extract integers from |
- Returns
-
Array of number
isdigit(char) → boolean
Checks if a character is a digit
Parameter
Name | Type | Optional | Description |
---|---|---|---|
char |
string |
|
The character to check |
- Returns
-
boolean
lines(str) → Array of string
Splits a string on "\n"
Parameter
Name | Type | Optional | Description |
---|---|---|---|
str |
string |
|
The string to split |
- Returns
-
Array of string
lower(str) → string
Converts a string to lower case
Parameter
Name | Type | Optional | Description |
---|---|---|---|
str |
string |
|
The string to convert |
- Returns
-
string
nums(str) → Array of number
Extracts all numbers from a string and returns them in an array
Parameter
Name | Type | Optional | Description |
---|---|---|---|
str |
string |
|
The string to extract numbers from |
- Returns
-
Array of number
upper(str) → string
Converts a string to upper case
Parameter
Name | Type | Optional | Description |
---|---|---|---|
str |
string |
|
The string to convert |
- Returns
-
string
words(str) → Array of string
Splits a string on spaces and trims each word
Parameter
Name | Type | Optional | Description |
---|---|---|---|
str |
string |
|
The string to split |
- Returns
-
Array of string