String

struct String
  • http://stackoverflow.com/a/24144365/2984775 Returns a truncated string based on an input leght and finished with a given trailing string

    Declaration

    Swift

    func trunc(length: Int, trailing: String = "...") -> String

    Parameters

    length

    Int describing the lenght for the string to be truncated at

    trailing

    String describing how to end the truncated text

    Return Value

    A truncated string finishing with a given string

  • Returns the character at index i in a string

    Declaration

    Swift

    subscript (i: Int) -> Character

    Parameters

    i

    Int describing the index for the character to be returned

  • Returns the character at index i in a string, as a String

    Declaration

    Swift

    subscript (i: Int) -> String

    Parameters

    i

    Int describing the index for the character to be returned

  • URL from string

    Declaration

    Swift

    func url() -> URL

    Return Value

    URL

  • Returns the CGSize for self based on the used UIFont

    Declaration

    Swift

    func cgSize(_ font: UIFont = UIFont.systemFont(ofSize: 12)) -> CGSize

    Return Value

    CGSize