Core Function IndexOfAny

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> IndexOfAny( <expression>, <needle>, <pos>, <case>, <count> ) </pre> === Description === Reports the index of the first occurrence of any character in a specified array o...")
 
(Description)
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
  
Reports the index of the first occurrence of any character in a specified array of characters or a string.
+
Reports the index of the first occurrence of any character in a specified array of characters or a string.
  
 
=== expression ===
 
=== expression ===

Revision as of 22:25, 20 August 2013

IndexOfAny( <expression>, <needle>, <pos>, <case>, <count> )

Contents

Description

Reports the index of the first occurrence of any character in a specified array of characters or a string.

expression

The string to use.

needle

The characters to find.

pos

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

Default: 0

case

Optional; Case sensitive option

false = Case sensitive search

true = Case insensitive search

Default: false

count

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

Default: expression length - pos

Return Value

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

Failure: Returns -1.

Remarks

None.

Example

Case sensitive

println(   IndexOfAny("The quick brown FoX", "qki")   );
println(   IndexOfAny("The quick brown FoX", "qkie")   );

Case insensitive

println(   IndexOfAny("The quick brown FoX", "QK", 0, true)   );
println(   IndexOfAny("The quick brown FoX", "EQ", 0, true)   );
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox