Check the letters are equal or not in swift for beginners

Check the letters are equal or not in swift for beginners. This program will check whether the letter is equal or not in swift. This is a==b concept is like strcmp in c. In swift programming language we can compare the elements by just using the == options. The following output is done with the help of == to print the output false.

let a = "WELCOME TO INLARN"
let b = "welcome to inlarn"
print(a == b)

 

Output:

false

What is let keyword in swift

In Swift, the let keyword can be used to construct immutable variables. An immutable variable is a constant that can only be initialised once. The keyword let is used to declare a constant value, which means that once you’ve given it an initial value, you won’t be able to change it. The variable var is used to declare the value of a variable. The keywords let and var are used to name variables in Swift. The let keyword declares a constant, which means it can’t be renamed after it’s been formed, but its variable properties can be changed afterwards. The var keyword declares a new variable with the ability to modify its value at any time.