Core Function IndexOf

From Sputnik Wiki
Revision as of 19:24, 29 January 2013 by UberFoX (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
IndexOf( <expression>, <needle>, <pos>, <case>, <count> )

Contents

Description

Reports the index of the first occurrence of the specified character in the current string. Parameters specify the starting search position in the current string and the type of search to use for the specified string. .

expression

The string to use.

needle

The character to find (If you pass a string here the first character of it will be used as the needle).

pos

Optional; Position to start the search from within the expression.

case

Optional; Case sensitive option

0 = Case sensitive search

1 = Case insensitive search

Default: 0

count

Optional; The amount of characters to check before quitting the search

Return Value

Success: Returns position of the found character in the string.

Failure: Returns -1.

Remarks

None.

Example

println(   IndexOf("The quick brown FoX", "X")   );
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox