What is the type of string in Swift?

Strings in Swift are Unicode correct and locale insensitive, and are designed to be efficient. The String type bridges with the Objective-C class NSString and offers interoperability with C functions that works with strings. … Wrap each expression in a string interpolation in parentheses, prefixed by a backslash.

Read more

How do you use while loop?

The loop will first execute the body, then check the condition, and, while it’s truthy, execute it again and again. For example: let i = 0; do { alert( i ); i++; } while (i < 3); This form of syntax should only be used when you want the body of the loop to execute at least once regardless of the condition being truthy.

Read more