File size: 4,135 Bytes
44efec5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
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:
- :ven:func:`ConvertToAsciiArray`
- :ven:func:`ConvertToCharArray`
- :ven:func:`FromAsciiArray`
- :ven:func:`Join`
- :ven:func:`JoinWithDelimiter`
- :ven:func:`Split`
- :ven:func:`Trim`
.. ven:function:: 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
:type i_strValue: Variable
:return: An array of ASCII codes, or an empty array if the input parameter is not a string
:rtype: Array
.. ven:function:: 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
:type i_strValue: Variable
:return: An array of characters (strings with length 1), or an empty array if the input parameter is not a string
:rtype: Array
.. ven:function:: 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
:type i_arrAsciiValues: Array
:return: 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.
:rtype: Variable
.. ven:function:: 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
:type i_arrValues: Array
:return: The concatenated form of all the strings in the array, or an empty string if the input parameter is not an array of strings
:rtype: Variable
.. ven:function:: 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
:type i_arrValues: Array
:type i_strDelimiter: Variable
:return: The concatenated strings from the array, with delimiters between each substring. An empty string if the input parameter is not an array of strings.
:rtype: Variable
.. ven:function:: 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
:type i_strValue: Variable
:type i_strDelimiter: Variable
:type i_bTrimWhitespaces: Boolean
:return: An array of strings containing each substring formed from splitting the original string
:rtype: Array
.. ven:function:: 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
:type i_strValue: Variable
:return: The trimmed string
:rtype: Variable
|