Instance Method


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


func appending(_ aString: String) -> String



The string to append to the receiver. This value must not be nil.

Return Value

A new string made by appending aString to the receiver.


This code excerpt, for example:

NSString *errorTag = @"Error: ";
NSString *errorString = @"premature end of file.";
NSString *errorMessage = [errorTag stringByAppendingString:errorString];

produces the string “Error: premature end of file.”.

See Also

Combining Strings

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

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