Compare String Lengths

STRING

Problem

Given two strings s1 and s2, return true if they have the same number of characters, and false otherwise.

Examples

areStringsSameLength("hello", "world") // true // Both "hello" and "world" have 5 characters. areStringsSameLength("apple", "banana") // false // "apple" has 5 characters, while "banana" has 6 characters. areStringsSameLength("", "") // true // Both strings are empty and have 0 characters.
Loading...