String

struct String
  • Returns a new string made by removing whitespace and newline characters from both ends of the receiver.

    Declaration

    Swift

    public var trimmed: String
  • Returns a new string made by replacing multiple space whitespace characters (matching the \\s regular expression character class) with a single space character.

    Declaration

    Swift

    public var collapsed: String
  • Returns a new string made by normalizing the whitespace characters in the receiver. Leading and trailing whitespace characters are trimmed (via the trimmed() function), then newlines are replaced with spaces, finally whitespace is collapsed (via the collapsed() function).

    Declaration

    Swift

    public var normalized: String