BIS fnc inString: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl>" to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...) |
||
Line 1: | Line 1: | ||
{{Function | {{Function | ||
| arma3 | | arma3 | ||
|1.00 | |1.00 | ||
|gr1 = Strings | |gr1 = Strings | ||
|Find a string within a string. | |Find a string within a string. | ||
| [searchTerm, searchText, caseSensitive] call BIS_fnc_inString; | | [searchTerm, searchText, caseSensitive] call BIS_fnc_inString; | ||
|p1= searchTerm: [[String]] - string to find | |p1= searchTerm: [[String]] - string to find | ||
|p2= searchText: [[String]] - string to search in | |p2= searchText: [[String]] - string to search in | ||
|p3= caseSensitive (optional): [[Boolean]] - defines whether the search is case-sensitive (true) or not (false, by default) | |p3= caseSensitive (optional): [[Boolean]] - defines whether the search is case-sensitive (true) or not (false, by default) | ||
| [[Boolean]] - true if search term is found, false if not | | [[Boolean]] - true if search term is found, false if not | ||
|x1= <code>["rabbit", "I ate a rabbit today"] call BIS_fnc_inString // will return true</code> | |x1= <code>["rabbit", "I ate a rabbit today"] call BIS_fnc_inString // will return true</code> | ||
|x2= <code>["RaBbiT", "I ate a rabbit today"] call BIS_fnc_inString // will return true</code> | |x2= <code>["RaBbiT", "I ate a rabbit today"] call BIS_fnc_inString // will return true</code> | ||
|x3= <code>["RaBbiT", "I ate a rabbit today", true] call BIS_fnc_inString // will return false because of case sensitivity</code> | |x3= <code>["RaBbiT", "I ate a rabbit today", true] call BIS_fnc_inString // will return false because of case sensitivity</code> | ||
| [[find]], [[BIS_fnc_filterString]], [[splitString]], [[joinString]] | | [[find]], [[BIS_fnc_filterString]], [[splitString]], [[joinString]] | ||
}} | }} |
Revision as of 23:08, 17 January 2021
Description
Syntax
- Syntax:
- [searchTerm, searchText, caseSensitive] call BIS_fnc_inString;
- Parameters:
- searchTerm: String - string to find
- searchText: String - string to search in
- caseSensitive (optional): Boolean - defines whether the search is case-sensitive (true) or not (false, by default)
- Return Value:
- Boolean - true if search term is found, false if not
Examples
- Example 1:
["rabbit", "I ate a rabbit today"] call BIS_fnc_inString // will return true
- Example 2:
["RaBbiT", "I ate a rabbit today"] call BIS_fnc_inString // will return true
- Example 3:
["RaBbiT", "I ate a rabbit today", true] call BIS_fnc_inString // will return false because of case sensitivity
Additional Information
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