String

public extension String
  • Returns a character at the given index.

    Declaration

    Swift

    subscript(i: Int) -> Character { get }

    Parameters

    i

    The index.

  • Returns a character at the given range.

    Declaration

    Swift

    subscript(r: PartialRangeFrom<Int>) -> Substring? { get }

    Parameters

    r

    The range.

  • Returns a character at the given range.

    Declaration

    Swift

    subscript(r: PartialRangeUpTo<Int>) -> Substring? { get }

    Parameters

    r

    The range.

  • Returns a character at the given range.

    Declaration

    Swift

    subscript(r: PartialRangeThrough<Int>) -> Substring? { get }

    Parameters

    r

    The range.

  • Returns a character at the given range.

    Declaration

    Swift

    subscript(r: ClosedRange<Int>) -> Substring? { get }

    Parameters

    r

    The range.

  • Returns a character at the given range.

    Declaration

    Swift

    subscript(r: Range<Int>) -> Substring? { get }

    Parameters

    r

    The range.

  • Undocumented

    Declaration

    Swift

    func substring(from index: Int) -> String?
  • Undocumented

    Declaration

    Swift

    func substring(to index: Int) -> String?
  • Undocumented

    Declaration

    Swift

    func substring(with aRange: Range<Int>) -> String?
  • Returns a String.Index object at the given index.

    Declaration

    Swift

    func index(at i: Int) -> String.Index

    Parameters

    i

    the index.

  • Inserts a character at a given position.

    Declaration

    Swift

    mutating func insert(_ newElement: Character, at position: Int)

    Parameters

    newElement

    The new character.

    position

    The given index.

  • Removes a character at a given position.

    Declaration

    Swift

    mutating func remove(at position: Int) -> Character

    Parameters

    position

    The given position

    Return Value

    The removes character.

  • Removes characters in a given range.

    Declaration

    Swift

    mutating func removeSubrange(_ bounds: Range<Int>)

    Parameters

    bounds

    The given range.

  • Declaration

    Swift

    public extension String.Index