To append a string in Swift, you can use the +
operator or the +=
operator. Here's an example of using the +=
operator:
main.swift85 chars4 lines
You can also use the append(_:)
method to append a single character at a time, like this:
main.swift80 chars4 lines
And finally, you can use string interpolation to concatenate a string value with other variables, like this:
main.swift124 chars5 lines
gistlibby LogSnag