IsBlacklistedPrefix
Appearance
| Environment: | Mission Scripting | |
|---|---|---|
| Function: | IsBlacklistedPrefix | |
| Function Description: | Checks if a string starts with any pattern defined in a blacklist, returning true and the matching pattern if found, otherwise false and nil. | |
| File Location: | cmm.stringFunctions.lua | |
| Syntax: | CMM.IsBlacklistedPrefix( string str , table blacklist ) | |
| Return Value: | boolean, string or nil | |
| Parameters: | Name | Description |
| str | The input string to check for blacklisted prefixes. | |
| blacklist | Table containing strings or patterns to match against the start of the input string. | |
| Example: | local found, pattern = CMM.IsBlacklistedPrefix("EnemyUnit", {"Enemy", "Player"}) | |
| Example Description: | Checks if the string "EnemyUnit" starts with either "Enemy" or "Player", returning true and "Enemy" as a match. | |
| Related Functions: | ||
| Notes: | ||