WildcardMatch

Category: Script / Strings
Since engine version: 1.0 OC

Description

Returns whether two strings are equal. The comparison is case sensitive and wildcards are supported.

Syntax

string WildcardMatch(string text, string wildcard);

Parameters

text:
String to compare.
wildcard:
String to compare.

Remark

A * can represent any number of unknown characters (including none). A ? represents exactly one unknown character.

Examples

public func IsRiding() { return WildcardMatch(GetAction(), "Ride*"); }
Returns true for all actions starting with "Ride" ("Ride" itself, but also "RideStill", "RideThrow", etc.).
WildcardMatch("Explode1", "Explode?");
Is true.
WildcardMatch("Explode10", "Explode?");
Is false.
WildcardMatch(GetName(), "*purz*");
Checks whether the name of the calling object contains "purz" (no matter where).
Clonkonaut, 2008-05