Saltar al contenido principal

strequal

aviso

This function was added in omp v1.1.0.2612 and will not work in earlier versions!

aviso

This function starts with a lowercase letter.

Description

Compares two strings to see if they are the same.

NameDescription
const string1[]The first string to compare.
const string2[]The second string to compare.
bool:ignorecase (optional)When set to true, the case doesn't matter - HeLLo is the same as Hello. When false, they're not the same.
length (optional)When this length is set, the first x chars will be compared - doing "Hello" and "Hell No" with a length of 4 will say it's the same string.

Returns

true if the strings match each other on given length, false otherwise.

Examples

new string1[] = "Hello World";
new string2[] = "Hello World";

// Check if the strings are the same
if (strequal(string1, string2))
{
print("Strings are equal.");
}
else
{
print("Strings are not equal.");
}

Notes

tip

This is a conveniece function that depends on strcmp.

  • strcmp: Search for a string in another string.