String (from HSLExtensions)
https://github.com/theonetruenerd/VenusPackages/blob/main/String.pkg
The String library from HSLExtensions adds a few functions to facilitate easier manipulation of strings. It adds the following functions:
- ConvertToAsciiArray(variable i_strValue)
This function converts the input string into an array with the regarding ASCII codes. If the input parameter is not a string the function returns an empty array.
- Params i_strValue:
The input string to be converted into an array
- Returns:
An array of ASCII codes, or an empty array if the input parameter is not a string
- Return type:
Array
- ConvertToCharArray(variable i_strValue)
This function converts the input string into an array with the regarding characters. If the input parameter is not a string the function returns an empty array.
- Params i_strValue:
The input string to be converted into an array
- Returns:
An array of characters (strings with length 1), or an empty array if the input parameter is not a string
- Return type:
Array
- FromAsciiArray(array i_arrAsciiValues)
This function converts an input array with ASCII codes into a string. If the input parameter is not an array with ASCII codes, the function returns an empty string.
- Params i_arrAsciiValues:
The input array of ASCII codes to be converted into a string
- Returns:
The output string formed by the concatenation of the converted versions of the ASCII codes. An empty string if the input parameter is not an array with ASCII codes.
- Return type:
Variable
- Join(array i_arrValues)
This function joins an array of strings into a single string. Can be used to concatenate any number of strings into a single one. If the input parameter is not an array with strings, the function returns an empty string.
- Params i_arrValues:
The array of strings to be concatenated
- Returns:
The concatenated form of all the strings in the array, or an empty string if the input parameter is not an array of strings
- Return type:
Variable
- JoinWithDelimiter(array i_arrValues, variable i_strDelimiter)
This function joins an array of strings into a single string and adds a delimiter between each substring. If the input parameter is not an array with strings, the function returns an empty string.
- Params i_arrValues:
The input array of strings to be concatenated
- Params i_strDelimiter:
The delimiter to be inserted between each substring
- Returns:
The concatenated strings from the array, with delimiters between each substring. An empty string if the input parameter is not an array of strings.
- Return type:
Variable
- Split(variable i_strValue, variable i_strDelimiter, variable i_bTrimWhitespaces)
This function splits a string into substrings, forming an array of strings. The input string is split based on a delimiter that the user inputs.
- Params i_strValue:
The input string to be split into substrings
- Params i_strDelimiter:
The delimiter to be used to split the string
- Params i_bTrimWhitespaces:
Boolean determining whether leading and trailing whitespaces will be removed or not
- Returns:
An array of strings containing each substring formed from splitting the original string
- Return type:
Array
- Trim(variable i_strValue)
This function trims leading and trailing whitespace characters from the input string. If the input parameter is not a string the function returns an empty string.
- Params i_strValue:
The input string to trim
- Returns:
The trimmed string
- Return type:
Variable