<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 10.14.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLUntypedColumn/init(strings:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Create ML",
      "CreateML"
    ],
    "preciseIdentifier" : "s:8CreateML15MLUntypedColumnV7stringsA2C_tcfc"
  },
  "title" : "init(strings:)"
}
-->

# init(strings:)

Creates a new column of strings by converting the elements of another
column.

```
init(strings: MLUntypedColumn)
```

## Parameters

`strings`

A column with elements that are convertible to string.

## Return Value

A new untyped column of doubles; otherwise an invalid column
if any element of the given column cannot be converted to
<doc://com.apple.documentation/documentation/Swift/String>.

## Discussion

Use this initializer to create a column of strings from another column.
As an example, to create a column with this initializer, first start
with a column that is convertible to strings.

```swift
let doublesColumn = MLUntypedColumn([1.0, 2.718, 3.14, 4.2, 5.1])
print(doublesColumn)
/* Prints...
 ValueType: Double
 Values:        [1.0, 2.718, 3.14, 4.2, 5.1]
 */
```

Then use [`init(strings:)`](/documentation/CreateML/MLUntypedColumn/init(strings:)) to convert the column to a
column of strings.

```swift
let stringsColumn = MLUntypedColumn(strings: doublesColumn)
print(stringsColumn)
/* Prints...
 ValueType: String
 Values:        [1, 2.718, 3.14, 4.2, 5.1]
 */
```

---

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)