Module: Toybox.StringUtil
Overview
The StringUtil module contains String utility functions
Classes Under Namespace
Classes: InvalidHexStringException
Constant Summary
-
CharacterEncoding
-
Representation
Name | Value | Since | Description | See Also |
---|---|---|---|---|
CHAR_ENCODING_UTF8 | 0 | API Level 3.0.0 |
Name | Value | Since | Description | See Also |
---|---|---|---|---|
REPRESENTATION_STRING_BASE64 | 0 | API Level 3.0.0 |
||
REPRESENTATION_STRING_HEX | 1 | API Level 3.0.0 |
||
REPRESENTATION_STRING_PLAIN_TEXT | 2 | API Level 3.0.0 |
||
REPRESENTATION_BYTE_ARRAY | 3 | API Level 3.0.0 |
Instance Method Summary collapse
-
charArrayToString(charArray as Lang.Array<Lang.Char>) as Lang.String
Given an Array of Char objects, return the String equivalent.
-
convertEncodedString(input as Lang.String or Lang.ByteArray, options as { :fromRepresentation as StringUtil.Representation, :toRepresentation as StringUtil.Representation, :encoding as StringUtil.CharacterEncoding }) as Lang.String or Lang.ByteArray
Convert a String or ByteArray representation to a String or ByteArray representation whose underlying byte format corresponds to the provided input options.
-
encodeBase64(string as Lang.String) as Lang.String
Encodes a String in base64.
-
utf8ArrayToString(utf8Array as Lang.Array<Lang.Number>) as Lang.String
Given an Array of UTF-8 bytes, return the String equivalent.
Instance Method Details
charArrayToString(charArray as Lang.Array<Lang.Char>) as Lang.String
Given an Array of Char objects, return the String equivalent
convertEncodedString(input as Lang.String or Lang.ByteArray, options as { :fromRepresentation as StringUtil.Representation, :toRepresentation as StringUtil.Representation, :encoding as StringUtil.CharacterEncoding }) as Lang.String or Lang.ByteArray
Convert a String or ByteArray representation to a String or ByteArray representation whose underlying byte format corresponds to the provided input options.
encodeBase64(string as Lang.String) as Lang.String
Encodes a String in base64
utf8ArrayToString(utf8Array as Lang.Array<Lang.Number>) as Lang.String
Given an Array of UTF-8 bytes, return the String equivalent