BIS fnc inString: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Text replacement - "<code> *([^<|{]*) *<\/code>" to "<sqf>$1</sqf>")
 
(23 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Function|Comments=
{{RV|type=function
____________________________________________________________________________________________


| arma3 |Game name=
|game1= arma3
|version1= 1.00


|1.00|Game version=
|gr1= Strings


|gr1 = Strings |GROUP1=
|descr=Find a string within a string.
____________________________________________________________________________________________


|Find a string within a string. |DESCRIPTION=
|s1= [searchTerm, searchText, caseSensitive] call [[BIS_fnc_inString]]
____________________________________________________________________________________________


| [searchTerm, searchText, caseSensitive] call BIS_fnc_inString; |SYNTAX=
|p1= searchTerm: [[String]] - string to find
|p2= searchText: [[String]] - string to search in
|p3= caseSensitive (optional): [[Boolean]] - defines whether the search is case-sensitive (true) or not (false, by default)


|p1= searchTerm: [[String]] - string to find|PARAMETER1=
|r1= [[Boolean]] - true if search term is found, false if not
|p2= searchText: [[String]] - string to search in|PARAMETER2=
|p3= caseSensitive (optional): [[Boolean]] - defines whether the search is case-sensitive (true) or not (false, by default)|PARAMETER3=


| [[Boolean]] - true if search term is found, false if not |RETURNVALUE=
|x1= <sqf>["rabbit", "I ate a rabbit today"] call BIS_fnc_inString // will return true</sqf>
____________________________________________________________________________________________


|x1= <code>["rabbit", "I ate a rabbit today"] call BIS_fnc_inString // will return true</code> |Example1=
|x2= <sqf>["RaBbiT", "I ate a rabbit today"] call BIS_fnc_inString // will return true</sqf>
 
|x3= <sqf>["RaBbiT", "I ate a rabbit today", true] call BIS_fnc_inString // will return false because of case sensitivity</sqf>
|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=
____________________________________________________________________________________________
 
| [[find]], [[BIS_fnc_filterString]], [[splitString]], [[joinString]] |SEEALSO=


|seealso= [[find]] [[BIS_fnc_filterString]] [[splitString]] [[joinString]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Strings|{{uc:inString}}]]
[[Category:Functions|{{uc:inString}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:inString}}]]

Latest revision as of 23:44, 12 July 2022

Hover & click on the images for description

Description

Description:
Find a string within a string.
Execution:
call
Groups:
Strings

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

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