CBA_fnc_find

Description

Finds a string within another string.

Parameters

_haystackString in which to search [String or ASCII char array]
_needleString to search for [String or ASCII char array]
_initialIndexInitial character index within _haystack to start the search at [Number: 0+, defaults to 0].

Returns

First position of string.  Returns -1 if not found [Number]

Examples

_result = ["frog-headed fish", "f"] call CBA_fnc_find;
// _result => 0

_result = ["frog-headed fish", "f", 5] call CBA_fnc_find;
// _result => 12

_result = ["frog-headed fish", "fish"] call CBA_fnc_find;
// _result => 12

Author

jaynus

Close