StringUtils

object StringUtils

A utility class for java.lang.Strings, used internally.

Functions

byteArrayToHexString
Link copied to clipboard
fun byteArrayToHexString(b: ByteArray): String

Convert a byte array to a hex sequence.

getBytesUtf8
Link copied to clipboard
fun getBytesUtf8(string: String): ByteArray

Get the bytes of a UTF-8 encoded java.lang.String.

hexStringToByteArray
Link copied to clipboard
fun hexStringToByteArray(s: String): ByteArray

Convert a hex sequence to a byte array.

newStringUtf8
Link copied to clipboard
fun newStringUtf8(bytes: ByteArray?): String?

Construct a new UTF-8 string from raw bytes.

parseCoinsAmount
Link copied to clipboard
fun parseCoinsAmount(text: String): Int
parseInt
Link copied to clipboard
fun parseInt(s: String): Int

Safely parse an integer from a java.lang.String.

stripHtml
Link copied to clipboard
fun stripHtml(s: String?): String

Removes tags from a string, which is anything around the characters < and >.

toDisplayCase
Link copied to clipboard
fun toDisplayCase(s: String): String

Converts a string to display case, where the first letter of every word is capitalised.

urlDecode
Link copied to clipboard
fun urlDecode(text: String): String

URL decode a UTF-8 java.lang.String.

urlEncode
Link copied to clipboard
fun urlEncode(text: String?): String?

URL encode a UTF-8 java.lang.String.