BIS fnc inString: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl>" to "")
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|Comments=
{{Function


| arma3 |Game name=
| arma3


|1.00|Game version=
|1.00


|gr1 = Strings |GROUP1=
|gr1 = Strings


|Find a string within a string. |DESCRIPTION=
|Find a string within a string.


| [searchTerm, searchText, caseSensitive] call BIS_fnc_inString; |SYNTAX=
| [searchTerm, searchText, caseSensitive] call BIS_fnc_inString;


|p1= searchTerm: [[String]] - string to find|PARAMETER1=
|p1= searchTerm: [[String]] - string to find
|p2= searchText: [[String]] - string to search in|PARAMETER2=
|p2= searchText: [[String]] - string to search in
|p3= caseSensitive (optional): [[Boolean]] - defines whether the search is case-sensitive (true) or not (false, by default)|PARAMETER3=
|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 |RETURNVALUE=
| [[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> |Example1=
|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> |EXAMPLE2=
|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> |EXAMPLE3=
|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]] |SEEALSO=
| [[find]], [[BIS_fnc_filterString]], [[splitString]], [[joinString]]


}}
}}

Revision as of 00:08, 18 January 2021

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:
findBIS_fnc_filterStringsplitStringjoinString

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


Bottom Section