iOS Swift Basics Swift Types String Manipulation

vivek d
vivek d
iOS Development Techdegree Student 662 Points

my code is not compiling

let name = "Vivek" let greeting = "Hi there, (name)" let finalGreeting = "(greeting) How are you?"

strings.swift
// Enter your code below
let name = "Vivek"
let greeting = "Hi there, \(name)"
let finalGreeting = "\(greeting) How are you?"

1 Answer

Shade Wilson
Shade Wilson
4,899 Points

Hi Vivek,

What you wrote works (although you're missing a period in between sentences in your finalGreeting), but what the challenge is looking for is string concatenation, not interpolation. In other words, concatenation means adding strings together just like how you would with two numbers, while interpolation is placing variables directly into the string.