<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSString/init(format:arguments:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSString(im)initWithFormat:arguments:"
  },
  "title" : "init(format:arguments:)"
}
-->

# init(format:arguments:)

Returns an `NSString` object initialized by using a given format string as a template into which the remaining argument values are substituted without any localization.

```
convenience init(format: String, arguments argList: CVaListPointer)
```

## Parameters

`format`

A format string. See [Formatting String Objects](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Strings/Articles/FormatStrings.html#//apple_ref/doc/uid/20000943) for examples of how to use this method, and [String Format Specifiers](https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFStrings/formatSpecifiers.html#//apple_ref/doc/uid/TP40004265) for a list of format specifiers. This value must not be `nil`.
  
  > Important:
  > Raises an `NSInvalidArgumentException` if `format` is `nil`.

`argList`

A list of arguments to substitute into `format`.

## Return Value

An `NSString` object initialized by using `format` as a template into which the values in `argList` are substituted according to the current locale. The returned object may be different from the original receiver.

## Discussion

This method is meant to be called from within a variadic function, where the argument list will be available.

This method invokes [`init(format:locale:arguments:)`](/documentation/Foundation/NSString/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.

> Important:
> When working with text that’s presented to the user, use the ``doc://com.apple.foundation/documentation/Foundation/NSString/localizedStringWithFormat:`` method, or the ``doc://com.apple.foundation/documentation/Foundation/NSString/initWithFormat:locale:`` or ``doc://com.apple.foundation/documentation/Foundation/NSString/init(format:locale:arguments:)`` method, passing ``doc://com.apple.foundation/documentation/Foundation/NSLocale/current`` as the locale.

## See Also

[`stringWithFormat:`](/documentation/Foundation/NSString/stringWithFormat:)

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



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)