String

struct String
  • Mutating version of self.replacingOccurrences(of:, with:, options:, range:)

    Declaration

    Swift

    public mutating func replaceOccurrences<Target: StringProtocol, Replacement: StringProtocol>(of target: Target, with replacement: Replacement, options: String.CompareOptions = [], locale: Locale? = nil)
  • Allows to get a substring from a string using an integer range.

    Declaration

    Swift

    public func substring(_ range: CountableClosedRange<Int>) -> String
  • Allows to get a substring from a string using an integer range.

    Declaration

    Swift

    public func substring(_ range: CountableRange<Int>) -> String
  • Allows to get a substring from a string using an integer range.

    Declaration

    Swift

    public func substring(_ range: PartialRangeThrough<Int>) -> String
  • Allows to get a substring from a string using an integer range.

    Declaration

    Swift

    public func substring(_ range: PartialRangeUpTo<Int>) -> String
  • Allows to get a substring from a string using an integer range.

    Declaration

    Swift

    public func substring(_ range: PartialRangeFrom<Int>) -> String
  • Helper function to convert an integer index (0-based) into a string index.

    Declaration

    Swift

    public func stringIndex(_ index: Int) -> Index