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 trialAbubakar Farax
Front End Web Development Techdegree Student 445 PointsString Manipulation
can someone help me with this step
// Enter your code below
let name ="Abubakar"
let greeting ="\(Hi there), \(abubakar)"
1 Answer
Jennifer Nordell
Treehouse TeacherHi there! You've got a few issues with your code. First, there should be a space between the equals sign and the quotation marks. Also, we use the backslash and parentheses to denote interpolation. This means that the compiler will take the value of a variable and insert it at that point. "Hi there" is not a variable, it's a string literal. Take a look:
// Enter your code below// Enter your code below
let name = "Abubakar"
let greeting = "Hi there, \(name)."
This will result in the constant greeting
containing the string "Hi there, Adubakar". This is because it takes the value in the name variable and puts it in the place we've told it inside the backslash and parentheses. As a final note, step one explicitly says that the string in the greeting constant needs to contain a full stop/period. Hope this helps!