<!--
{
  "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(string:)-210xa",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSString(im)initWithString:"
  },
  "title" : "init(string:)"
}
-->

# init(string:)

Returns an `NSString` object initialized by copying the characters from another given string.

```
convenience init(string aString: String)
```

## Parameters

`aString`

The string from which to copy characters. This value must not be `nil`.
  
  > Important:
  > Raises an `NSInvalidArgumentException` if `aString` is `nil`.

## Return Value

An `NSString` object initialized by copying the characters from `aString`. The returned object may be different from the original receiver.

## See Also

[`+  stringWithString:`](/documentation/Foundation/NSString/stringWithString:)

Returns a string created by copying the characters from another given string.



---

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)