What is concatenation?

Concatenation is to link together two objects of any sort. Let’s say we would like to concatenate A & B, it just means we would like to link A & B together and the output would be A B. In Swift, there are many different ways to concatenate two objects. Some of follow example are as follow:

let a = "a"
let b = "b"

let output = a + b 
// ab
let output1 = "A: \(a) " + "B: \(b)"
// A: a B: b

There are time that you would like to concatenate a data with a description and you could use the output1 or in times you only would like to concatenate the data, then you could use output

  • Article By :
    Founder of DaddyCoding. Studied Computer Science, Information System and Information Technology at BYU-Hawaii. Currently spending most of my time researching and learning on helping to expose making iOS apps.

Random Posts

Leave a Reply

Your email address will not be published. Required fields are marked *