<!--
{
  "availability" : [
    "iOS: 8.0.0 - 16.0.0",
    "iPadOS: 8.0.0 - 16.0.0",
    "macCatalyst: 8.0.0 - 16.0.0",
    "macOS: 10.10.0 - 13.0.0",
    "tvOS: 9.0.0 - 16.0.0",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 - 9.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/String/init(utf16CodeUnitsNoCopy:count:freeWhenDone:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:SS10FoundationE20utf16CodeUnitsNoCopy5count12freeWhenDoneSSSPys6UInt16VG_SiSbtcfc"
  },
  "title" : "init(utf16CodeUnitsNoCopy:count:freeWhenDone:)"
}
-->

# init(utf16CodeUnitsNoCopy:count:freeWhenDone:)

Creates a new string that contains the specified number of characters
from the given C array of UTF-16 code units.

```
init(utf16CodeUnitsNoCopy: UnsafePointer<unichar>, count: Int, freeWhenDone flag: Bool)
```

---

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)