Generic Instance Method


Appends the characters in the given sequence to the string.


mutating func append<S>(contentsOf newElements: S) where S : Sequence, S.Element == Character



A sequence of characters.


Generic Constraints

  • S : Sequence
  • S.Element == Character

See Also

Appending Strings and Characters

func append(Character)

Adds an element to the end of the collection.

func append(String)

Appends the given string to this string.

func append<S>(contentsOf: S)

Adds the elements of a sequence or collection to the end of this collection.

func appending(String)

Returns a new string made by appending a given string to the String.

func appendingFormat(String, CVarArg...)

Returns a string made by appending to the String a string constructed from a given format string and the following arguments.

func padding(toLength: Int, withPad: String, startingAt: Int)

Returns a new string formed from the String by either removing characters from the end, or by appending as many occurrences as necessary of a given pad string.

func reserveCapacity(Int)

Reserves enough space in the string’s underlying storage to store the specified number of ASCII characters.