<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/IntegerParseStrategy/init(format:lenient:)-124xn",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation20IntegerParseStrategyV6format7lenientACyAA0B11FormatStyleVyqd__GGAH_SbtcAHRszSzRd__lufc"
  },
  "title" : "init(format:lenient:)"
}
-->

# init(format:lenient:)

Creates a parse strategy instance using the specified integer format style.

```
init<Value>(format: Format, lenient: Bool = true) where Format == IntegerFormatStyle<Value>, Value : BinaryInteger
```

## Parameters

`format`

A configured [`IntegerFormatStyle`](/documentation/Foundation/IntegerFormatStyle) that describes the string format to parse.

`lenient`

A Boolean value that indicates whether the parse strategy should permit some discrepencies when parsing. Defaults to `true`.

## Discussion

---

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)