Help converting swift 4 code snip to version 5?

Trying to remember what I was doing here, but this code apparently no longer works in Swift 5.

let s = String(describing: confType).characters.prefix(1)
//                                   ^~~~~~~~~~
//                                   error here

So String.characters no longer works, what is the Swift 5 equivalent? I cant find the docs for 4.0.

Forgot error message:

Swift.String:5:16: note: 'characters' was obsoleted in Swift 5.0
    public var characters: String { get set }

Just drop it, string is a collection of characters.

1 Like

Thanks that worked, I was trying to use String[] as an array of chars but I need a Swift refresher. :smile: