BIS fnc inString: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - "\[\[[cC]ategory:\{\{Name\|arma3\}\}: [fF]unctions\|\{\{uc:[a-z A-Z_]*\}\}\]\]" to "") |
Lou Montana (talk | contribs) m (Text replacement - "<code> *([^<|{]*) *<\/code>" to "<sqf>$1</sqf>") |
||
(13 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{RV|type=function | {{RV|type=function | ||
| arma3 | |game1= arma3 | ||
|version1= 1.00 | |||
| | |gr1= Strings | ||
| | |descr=Find a string within a string. | ||
| | |s1= [searchTerm, searchText, caseSensitive] call [[BIS_fnc_inString]] | ||
|p1= searchTerm: [[String]] - string to find | |p1= searchTerm: [[String]] - string to find | ||
Line 15: | Line 14: | ||
|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 | |r1= [[Boolean]] - true if search term is found, false if not | ||
|x1= < | |x1= <sqf>["rabbit", "I ate a rabbit today"] call BIS_fnc_inString // will return true</sqf> | ||
|x2= < | |x2= <sqf>["RaBbiT", "I ate a rabbit today"] call BIS_fnc_inString // will return true</sqf> | ||
|x3= < | |x3= <sqf>["RaBbiT", "I ate a rabbit today", true] call BIS_fnc_inString // will return false because of case sensitivity</sqf> | ||
| [[find]] | |seealso= [[find]] [[BIS_fnc_filterString]] [[splitString]] [[joinString]] | ||
}} | }} |
Latest revision as of 22:44, 12 July 2022
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:
- Example 2:
- Example 3:
Additional Information
- See also:
- find BIS_fnc_filterString 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