Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Swift Basics Swift Types String Manipulation

Please help I'm stuck on the greeting part.

help

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

5 Answers

andren
andren
28,558 Points

When you use string interpolation you only need to put the name of the string you want to insert within the \(). The regular text should be written like normal. So the code should look like this:

let name = "warren"
let greeting = "Hi there, \(name)"
Jeff McDivitt
Jeff McDivitt
23,970 Points
let name: String = "Jeff"
let greeting = "Hi there, \(name)"
let finalGreeting = "\(greeting)" + "How are you?"
Martel Storm
Martel Storm
4,157 Points

Aye Jeff you seem to be further along than me and we started at similar times. How are you doing this! Also how are you feeling about your own progress? Feel like you can develop ios well enough to get a job?

Jeff McDivitt
Jeff McDivitt
23,970 Points

Hi Martel - I attempt to spend at least an hour a day programming. I feel pretty good with my progress. I feel that I can develop good enough to get an entry level job, but I am just doing this as a hobby; so I have not really looked!

Martel Storm
Martel Storm
4,157 Points

Wanna be friends so we can track progress and shit together? Sometimes I get in ruts and just like to talk about code with someone but it's hard to find people that code even more specifically in swift.

Martel Storm
Martel Storm
4,157 Points

They should implement some sort of Chat option besides comments. Find me on Facebook? I reside in Knoxville, TN

Jeff McDivitt
Jeff McDivitt
23,970 Points

I gave up social media a year ago, best decision I ever made. Here is my email mcd132002@yahoo.com, email me and I can give you my number