ReversedCharsView

public struct ReversedCharsView { /* private fields */ }

A reversed view over the code points in a string. Iterates characters back-to-front without allocating.

Examples

let view = "abc".chars.reversed; view.first(); // Some('c') view.count; // 3

Properties

public var count: Int64 { get }

Number of code points. O(n).

public var first: Char? { get }

The first element of the reversed view (= last char of the source).

public var isEmpty: Bool { get }

Initializers

public init(slice: StringSlice)

ImplementsIterable

Associated Types

type Item = Char
type TargetIterator = ReversedCharsIterator

Methods

public func iter() -> ReversedCharsIterator

ImplementsCloneable

Methods

public func clone() -> ReversedCharsView

Defined in lang/std/text/views.ks