Jump to content

IsBlacklistedPrefix

From CMM Wiki
Revision as of 10:12, 11 November 2025 by Ozdeadmeat (talk | contribs) (IsBlacklistedPrefix – created via PowerShell script (2025-11-11T21:12:47Z))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Return to CMM Command Reference
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
strThe input string to check for blacklisted prefixes.
blacklistTable 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: