String

Associated Functions for the String type

Built-in associated functions for the String type.

UTF-8 encoded string with dynamic or fixed capacity.


String Operations

starts_with

fn starts_with(self, str: String) -> Bool

Returns true if the string starts with the specified prefix.

repeat

fn repeat(self, count: Int) -> String

Returns a new string with this string repeated count times.

chars

fn chars(self) -> [Char]

Returns a vector view of the string’s Unicode codepoints (Char).


For additional associated functions like len, push, slice, etc., see Vec associated functions and Sequential associated functions.