iOS Swift Basics Swift Types String Manipulation

Stephen Riggs
Stephen Riggs
312 Points

I have no idea what I am doing wrong. It works in X Code

let name = "Stephen" let greeting = "Hi, there" let interpolatedGreeting = "(greeting), (name)"

// it is saying I need to attach a interpolated string to greeting

strings.swift
// Enter your code below
let name = "Stephen"
let greeting = "Hi there" 
let interpolatedGreeting = "\(greeting), \(name)"

1 Answer

Gene Bogdanovich
Gene Bogdanovich
9,162 Points

There you go, use this code. You don't have to create the third variable

// Enter your code below
let name = "Stephen"
let greeting = "Hi there, \(name)" 

Happy coding!