Basic question
I have 2 strings. I want to add one string to another? Here's an example:
var secondString= "is your name."
var firstString = "Mike, "
Here I have 2 strings. I want to add firstString
to secondString
, NOT vice versa. (Which would be: firstString += secondString
.)
More detail
I have 5 string
let first = "7898"
let second = "00"
let third = "5481"
let fourth = "4782"
var fullString = "\(third):\(fourth)"
I know for sure that third
and fourth
will be in fullString
, but I don't know about first
and second
.
So I will make an if statement
checking if second
has 00
. If it does, first
and second
won't go in fullString
. If it doesn't, second will go into
fullString`.
Then I will check if first
has 00
. If it does, then first
won't go inside of fullString
, and if not, it will go.
The thing is, I need them in the same order: first, second, third fourth. So in the if statement, I need a way to potentially add first
and second
at the beginning of fullString
.