Testing String Equality
In the following lesson, you will learn how to compare strings in Scala.
Problem
We want to compare two strings to check whether they are equal. When strings are equal, it simply means that both strings are composed of the same characters in the same order, i.e., they are identical.
Solution
In Scala, you use the ==
method to test the equality of two objects. The result will either be true or false depending on whether the objects are ...