substring(to:)

Returns a new string containing the characters of the String up to, but not including, the one at a given index.

Declaration

func substring(to index: Self.Index) -> String