Equality
Syntax
$string1.isStringEqual($string2)
$string1.isStringEqual($string2, $case-sensitive)
Description
Compares the strings string1
and string2
for equality.
Parameter
Name | Type | Description | Mandatory | Default |
---|---|---|---|---|
string1 | String | A string to check if it matches string2 |
yes | |
string2 | String | A string to check if it matches string1 |
yes | |
case-sensitive | Boolean | Determines whether case sensitivity should be considered. | no | false - case sensitivity is not considered. |
Return value
Type: Boolean
Whether string1
matches string2
.
Examples
Simple comparison
isStringEqual("Hello world!", "Hello world!")
Output: true
Case sensitive comparison 1
isStringEqual("Hello world!", "Hello world!", true)
Output: true
Case sensitive comparison 2
isStringEqual("Hello world!", "hello world!", true)
Output: false