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

Pankha Singh
Pankha Singh
1,152 Points

how do I do this

whatever I do. this won't let me pass

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

1 Answer

Matt Skelton
Matt Skelton
4,548 Points

Hey Pankha,

The compiler is pretty strict and requires you to assign very specific values to your variables.

As an example, the final value of greeting could be "Hi there, Linda".

So, we're trying to achieve a string with the value of "Hi there, Pankha". Compare that to what you currently have, which is " Hi ther, Pankha ".

Notice the extra spaces at the start and end of the string? They'll cause you problems. Finally, correct the typo to 'there', and you'll be good to go. Just bear this sort of thing in mind when tackling future challenges, as it's a common issue that may trip you up!

Good luck!