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

# init(_:)

Creates a new string containing the characters in the given sequence.

```
init<S>(_ other: S) where S : LosslessStringConvertible, S : Sequence, S.Element == Character
```

## Parameters

`other`

A string instance or another sequence of
characters.

## Discussion

You can use this initializer to create a new string from the result of
one or more collection operations on a string’s characters. For example:

```
let str = "The rain in Spain stays mainly in the plain."

let vowels: Set<Character> = ["a", "e", "i", "o", "u"]
let disemvoweled = String(str.lazy.filter { !vowels.contains($0) })

print(disemvoweled)
// Prints "Th rn n Spn stys mnly n th pln."
```

---

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)