Page tree
Skip to end of metadata
Go to start of metadata




Introduced in

Version:1.24

Description

Description:Returns the position of one string inside the other string (case-insensitive).

Syntax

Syntax:[baseStr, findStr, case, start] call fn_vbs_StrIndex
Parameters:
  • baseStr: String - String that is being searched.
  • findStr: String - String being searched for.
  • case (V1.34+): Boolean - Should the search be case-sensitive (optional, default: false).
  • start (V1.34+): Number - Character index to start the find/replace operation from (optional, default: 0 - represents the first character).
Return Value:Number - Position found (0-based), -1 if not found.

Warning

When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.

Examples

Examples:
_found=["OneTwoThree","two"] call fn_vbs_StrIndex;
// Returns: 3 
_found=["OneTwoThreeOneTwoThree","two", false, 4] call fn_vbs_StrIndex; 
// Returns: 14 

Additional Information

See also: in, find, fn vbs StrInStr
Multiplayer: 
Problems: 

Notes