swift compare strings

Swift
var str1 = "Hello, world"
print(str1)print("foo".elementsEqual("bar")) //false// Create a literal empty string
var emptyString = ""

// Create an optional string
var emptyVariable: String?  // This allows this variable to have a null value, or nil in swift
Source

Also in Swift: