Search⌘ K
AI Features

Solution Review: String Comparison

Explore how to compare two strings in ReasonML by using conditional expressions like if-else. Learn to use String.length() to check string lengths and apply conditionals to append strings correctly, enhancing your understanding of ReasonML condition constructs.

We'll cover the following...
...
Reason
let str1 = "Venus";
let str2 = "Neptune"
if(String.length(str1) >= String.length(str2)) {
Js.log(str1 ++ str2);
}
else {
Js.log(str2 ++ str1);
};
...