BIS fnc inString: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - "\[\[Category\:Function Group\: Strings(\|\{\{[a-zA-Z0-9_:]+\}\})?\]\]" to "") |
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
||
Line 1: | Line 1: | ||
{{Function|Comments= | {{Function|Comments= | ||
| arma3 |Game name= | | arma3 |Game name= | ||
Line 7: | Line 6: | ||
|gr1 = Strings |GROUP1= | |gr1 = Strings |GROUP1= | ||
|Find a string within a string. |DESCRIPTION= | |Find a string within a string. |DESCRIPTION= | ||
| [searchTerm, searchText, caseSensitive] call BIS_fnc_inString; |SYNTAX= | | [searchTerm, searchText, caseSensitive] call BIS_fnc_inString; |SYNTAX= | ||
Line 19: | Line 16: | ||
| [[Boolean]] - true if search term is found, false if not |RETURNVALUE= | | [[Boolean]] - true if search term is found, false if not |RETURNVALUE= | ||
|x1= <code>["rabbit", "I ate a rabbit today"] call BIS_fnc_inString // will return true</code> |Example1= | |x1= <code>["rabbit", "I ate a rabbit today"] call BIS_fnc_inString // will return true</code> |Example1= | ||
Line 25: | Line 21: | ||
|x2= <code>["RaBbiT", "I ate a rabbit today"] call BIS_fnc_inString // will return true</code> |EXAMPLE2= | |x2= <code>["RaBbiT", "I ate a rabbit today"] call BIS_fnc_inString // will return true</code> |EXAMPLE2= | ||
|x3= <code>["RaBbiT", "I ate a rabbit today", true] call BIS_fnc_inString // will return false because of case sensitivity</code> |EXAMPLE3= | |x3= <code>["RaBbiT", "I ate a rabbit today", true] call BIS_fnc_inString // will return false because of case sensitivity</code> |EXAMPLE3= | ||
| [[find]], [[BIS_fnc_filterString]], [[splitString]], [[joinString]] |SEEALSO= | | [[find]], [[BIS_fnc_filterString]], [[splitString]], [[joinString]] |SEEALSO= |
Revision as of 23:15, 16 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