WildcardMatch

Category: Script / Strings
Since engine version: 4.9.5.0 CE

Description

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

Syntax

string WildcardMatch (string szStr, string szWildcard);

Parameters

szStr:
String to compare.
szWildcard:
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, Mai 2008