Skip to content

Instantly share code, notes, and snippets.

@clarkeben
Last active September 20, 2023 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clarkeben/bf0b64490f5975ec943b3cebcce72f9f to your computer and use it in GitHub Desktop.
Save clarkeben/bf0b64490f5975ec943b3cebcce72f9f to your computer and use it in GitHub Desktop.
swift-string-concatenation
let messages = ["Hi", "welcome", "to", "my", "home"]
let combinedMessages = messages.joined(separator: " ") //Hi welcome to my home
let firstName = "John"
let lastName = "Doe"
let fullName = firstName + " " + lastName //John Doe
let address = "742 Evergreen Terrace"
let message = "I live at \(address)!" //I live at 742 Evergreen Terrace!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment