BIS fnc filterString: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\|seealso= ([^ ]+)(\]\]|\}\}), *(\[\[|\{\{)" to "|seealso= $1$2 $3") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
(One intermediate revision by the same user not shown) | |||
Line 8: | Line 8: | ||
|descr= Removes characters from a string based on the list of allowed characters. | |descr= Removes characters from a string based on the list of allowed characters. | ||
|s1= [ text, | |s1= [text, allowedChars] call [[BIS_fnc_filterString]] | ||
|p1= '''text:''': [[String]] - | |p1= '''text:''': [[String]] - text to filter | ||
|p2= ''' | |p2= '''allowedChars''': [[String]] - (Optional, default a..z, A..Z, 0..9, "_") allowed characters | ||
|r1= [[String]] - | |r1= [[String]] - filtered text with only the allowed characters supplied in the filter. | ||
|x1= < | |x1= <sqf>["Player 1 @%!@$"] call BIS_fnc_filterString; // returns "Player1"</sqf> | ||
|x2= < | |x2= <sqf>["Player 1", "aelrPy"] call BIS_fnc_filterString; // returns "Player"</sqf> | ||
|seealso= [[find]] [[BIS_fnc_inString]] [[splitString]] [[joinString]] | |seealso= [[find]] [[BIS_fnc_inString]] [[splitString]] [[joinString]] | ||
}} | }} |
Latest revision as of 17:22, 13 July 2022
Description
- Description:
- Removes characters from a string based on the list of allowed characters.
- Execution:
- call
- Groups:
- Strings
Syntax
- Syntax:
- [text, allowedChars] call BIS_fnc_filterString
- Parameters:
- text:: String - text to filter
- allowedChars: String - (Optional, default a..z, A..Z, 0..9, "_") allowed characters
- Return Value:
- String - filtered text with only the allowed characters supplied in the filter.
Examples
- Example 1:
- Example 2:
Additional Information
- See also:
- find BIS_fnc_inString splitString joinString
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note