Companion

object Companion

Functions

Link copied to clipboard
fun formatString(pattern: String, vararg args: Any): A_String

Given a Java String containing a substitution format and its arguments, perform pattern substitution and produce the corresponding Avail string.

Link copied to clipboard
fun generateStringFromCodePoints(size: Int, generator: (Int) -> Int): A_String

Produce an Avail string from the given generator of Unicode code points. Attempt to use a ByteStringDescriptor representation first, but generalize it to a TwoByteStringDescriptor or even an ObjectTupleDescriptor as needed.

Link copied to clipboard
fun stringFrom(aNativeString: String): A_String

Convert the specified Java String to an Avail A_String.

Link copied to clipboard
fun stringWithSurrogatesFrom(aNativeString: String): A_String

Convert the specified Java String to an Avail A_String, but keeping any Java surrogate pairs as two distinct values in the Avail string. Note that such a string is semantically different from what would be produced by stringFrom, and isn't even necessarily the same length. This operation is intended for compatibility with Java (and JavaScript) strings.