String

extension String
  • Returns space-separated hex codes of unicode characters in self, like “66 6c 61 67 73 20 1f1e7 1f1f7 1f1f3 1f1ff”

    Declaration

    Swift

    var hexDump: String { get }
  • Returns an array of substrings in self that matched the regex pattern

    Declaration

    Swift

    func matches(for regex: String) -> [String]

    Parameters

    regex

    pattern

    Return Value

    [String]

  • Check if self is blank (is empty or consists of whitespace characters only)

    Declaration

    Swift

    func isBlank() -> Bool

    Return Value

    true if self is blank

  • Returns true if self matches the regex pattern

    Declaration

    Swift

    func doesMatch(regex: String) -> Bool

    Parameters

    regex

    pattern

    Return Value

    Bool

  • Returns UUID (if any) found in self

    Declaration

    Swift

    func extractUUID() -> String

    Return Value

    String that matched the UUID pattern or empty string

  • Returns a copy of self with 1st letter capitalized

    Declaration

    Swift

    func capitalizingFirstLetter() -> String
  • Capitalizes 1st letter

    Declaration

    Swift

    mutating func capitalizeFirstLetter()
  • Capitalizes 1st letter and inserts a space before any other capital letter

    Declaration

    Swift

    var camelCaseSplit: String { get }