1The values of strings and characters can be obtained by the addition operator (+) to add together and create a new string value:2Let string1 ="Hello"3Let string2 ="there"4Let Character1:character ="!"5Let Character2:character ="?"6Let Stringpluscharacter = string1 + character1//equals "hello!."7Let stringplusstring = string1 + string2//equals "Hello there"8Let characterplusstring = Character1 + string1//equals "!hello."9Let Characterpluscharacter = Character1 + character2//equals "!?"TenYou can also use the addition assignment operator (+ =) adds a string or character to a string variable that already exists: Onevar instruction =" look over" AInstruction + =string2 - //instruction now equals "look over there." -var welcome ="Good Morning" theWelcome + =Character1 - //welcome now equals "good morning!." -Note: You cannot add a string or character to a character variable that already exists because the character variable can contain only one character.
Swift connection strings and characters