Contents

stringWithFormat:

Returns a string created by using a given format string as a template into which the remaining argument values are substituted.

Declaration

+ (instancetype) stringWithFormat:(NSString *) format;

Parameters

  • format:

    A format string. See 20000943 for examples of how to use this method, and TP40004265 for a list of format specifiers. This value must not be nil.

Return Value

A string created by using format as a template into which the remaining argument values are substituted without any localization.

Discussion

Pass a comma-separated list of trailing variadic arguments to substitute into format.

This method invokes init(format:locale:arguments:) without applying any localization. This is useful, for example, when working with fixed-format representations of information that is written out and read back in at a later time.

See Also

Creating and Initializing Strings