iOS Swift Basics Swift Types String Manipulation

Blake Delle Fave
PRO
Blake Delle Fave
Pro Student 108 Points

I can't understand how my interpolated greeting is wrong.

I am trying to input a string literal into an interpolated line of code, but the compiler keeps telling me that I can't interpret an interpolation the way that I wrote the code.

interpolatedGreeting = "(Hi there) , (Linda)"

What am I missing?

strings.swift
// Enter your code below

let name = "BlakeDelleFave"

let greeting = "hi there" + "name"

let interpolatedGreeting = "\(Greeting) , \(Linda)"

1 Answer

Daniel Turato
PRO
Daniel Turato
Java Web Development Techdegree Graduate 30,102 Points

As the greeting constant itself should be the interpolated string. So greeting should be like this:

let greeting = "Hi there, \(name)"