aiken/string

Functions

concat(left: String, right: String) -> String

Combine two String together.

string.concat(left: @"Hello", right: @", World!") == @"Hello, World!"

from_bytearray(bytes: ByteArray) -> String

Convert a ByteArray into a String


⚠️
WARNING
This functions fails if the underlying ByteArray isn’t UTF-8-encoded.
In particular, you cannot convert arbitrary hash digests using this function.
For converting arbitrary ByteArrays, use bytearray.to_hex.
string.from_bytearray("foo") == @"foo"

string.from_bytearray(#"666f6f") == @"foo"

string.from_bytearray(some_hash) -> fail

from_int(n: Int) -> String

Convert an Int to its String representation.

string.from_int(42) == @"42"

join(list: List<String>, delimiter: String) -> String

Join a list of strings, separated by a given delimiter.

string.join([], @"+") == @""
string.join([@"a", @"b", @"c"], @",") == @"a,b,c"

to_bytearray(self: String) -> ByteArray

Convert a String into a ByteArray

string.to_bytearray(@"foo") == "foo"
Search Document