DEV Community

loading...

Urgent Assistant on this IOS CODE, stuck

kchidza profile image Kellington Chidza ・1 min read

Given the struct below in the editor, we want to add a method that returns the person’s full name. Declare a method named fullName() that returns a string containing the person’s full name. Note: Make sure to allow for a space between the first and last name.

func getFullName() -> String {
return "(firstName) (lastName)"
}
}


where am i getting it wrong

Discussion (1)

Collapse
charlesvu profile image
Charles Vu

You are missing the '\' before the opening parenthesis.

func getFullName() -> String {
    return "\(firstName) \(lastName)"
}
Forem Open with the Forem app