streqi
streqi <a> <b>
Whether two strings are equal, ignoring case.
Use streqi to compare text without worrying about capitalisation — the
common case when matching player input. For an exact, case-sensitive
comparison use the eq operator instead.
Arguments
<a>— the first string.<b>— the second string.
Returns
A bool — true if the two strings are equal ignoring case, false otherwise.
Examples
after command (say) {
do "say streqi=[streqi 'Foo' 'foo']."
}
Foo and foo differ only in case, so [streqi ...] is true.
after command (say) {
require [streqi $arg "open sesame"]
emit room "The wall grinds open."
}
$arg holds the whole say argument as one string; the guard fires the
handler only when the actor said exactly open sesame (in any case), and
advances otherwise (see require and
Handlers for the $arg binding).
See also
isabbrev— case-insensitive prefix match instead of full equality.eq— exact, case-sensitive equality.keyword— match input words against several candidates at once.- Strings and interpolation