Page tree
Skip to end of metadata
Go to start of metadata




Introduced in

Version:3.4

Description

Description:Removes the specified characters from a string.

Syntax

Syntax:[base, blacklist, whitelist] call fn_vbs_filterString
Parameters:
  • base: String - Base string to filter.
  • blacklist: String - Each character within this string is removed from the base string.
  • whitelist: String - Only characters contained in this string are returned from the base string. Any characters defined in blacklist override those in whitelist.
Return Value:String - Filtered base string.

Warning

When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.

Examples

Examples:
["12345123456","13",""] call fn_vbs_filterString; // Returns "2452456" 
["12345123456","","13"] call fn_vbs_filterString; // Returns "1313" 
["12345123456","1","13"] call fn_vbs_filterString; // Returns "33" 

Additional Information

See also: fn vbs replaceString
Multiplayer: 
Problems: 

Notes







Note: the case-sensitive replacement option is available in versions below v1.22, but is bugged and does not work properly.