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 just someone copy and paste me the answer I really need help

give me the answer please

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

1 Answer

Alexandra Barnett
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Alexandra Barnett
Front End Web Development Techdegree Graduate 46,473 Points

Hi Rico! For the first task, you just want two variables - name and greeting. In the greeting variable, you assign the string that will contain your name. Now, rather than typing your name, you can use the interpolation that you have used in your greetin variable above. You had all the elements, just not quite in the way the task wanted :)

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

Hope that helps - let me know if you have any questions :)

thx alex