THP Logo THP
class

String

A list of characters representing text.

THP strings are

Common operations

  • Op 1
  • Op 2: ref
val name = "hello"

Type Parameters

A

The type of the elements in the array.

Functions

fun push(mut self, element: A) -> Usize

Adds an element to the end & returns the new length of the array.

fun pop(mut self) -> A

Removes the last element & returns that element.

fun map(self, callback: (A) -> B) -> Array[B]

Creates a new array with the results of calling a function on every element.

fun is_empty(self) -> Bool

Returns true if the array has no elements.

fun clear(mut self)

Removes all elements from the array.

See Also