Swift 4 : 'init(_offset:)' is unavailable : > Swift 4 : 'init(_offset:)' is unavailable

Iam trying to expand variable names (enclosed by curly braces).

    let message = "Hello {what}".expand(["what" : "world"])                
    print(message) // Hello World

I used this for dynamic url construction.

Upto Swift 3.2 it is working fine. When I tried to convert it to Swift 4 its throwing error. `'init(_offset:)' is unavailable` in the below line.

    let templateStartChar = "{".utf16[String.UTF16View.Index(_offset: 0)]