Core Function IndexNotOfAny

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> IndexNotOfAny( <expression>, <needle>, <pos>, <case>, <count> ) </pre> === Description === Reports the index of the first none occurrence of any character in a specified ...")
 
m (1 revision)
 
(4 intermediate revisions by one user not shown)
Line 1: Line 1:
 
<pre>
 
<pre>
IndexNotOfAny( <expression>, <needle>, <pos>, <case>, <count> )
+
Reports the index of the first none occurrence of any characters or array of strings in a specified string.
 
</pre>
 
</pre>
  
 
=== Description ===
 
=== Description ===
  
Reports the index of the first none occurrence of any character in a specified array of characters or a string.
+
Reports the index of the first none occurrence of any characters or array of strings in a string.
  
 
=== expression ===
 
=== expression ===
Line 13: Line 13:
 
=== needle ===
 
=== needle ===
  
The characters to not find.
+
The characters to not find OR an array of strings not to find.
  
 
=== pos ===
 
=== pos ===
Line 52: Line 52:
  
 
<syntaxhighlight lang="sputnik">
 
<syntaxhighlight lang="sputnik">
 +
// Search for non-occurrence of characters
 
println(  IndexNotOfAny("The quick brown FoX", "The")  );
 
println(  IndexNotOfAny("The quick brown FoX", "The")  );
 +
// Search for non-occurrence of a string
 +
println(  IndexNotOfAny("The quick brown FoX", array("The"))  );
 +
// Search for non-occurrence of array of strings
 +
println(  IndexNotOfAny("The quick brown FoX", array("brown ", "The ", "quick "))  );
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 58: Line 63:
  
 
<syntaxhighlight lang="sputnik">
 
<syntaxhighlight lang="sputnik">
 +
// Search for non-occurrence of characters
 
println(  IndexNotOfAny("The quick brown FoX", "tHE", 0, true)  );
 
println(  IndexNotOfAny("The quick brown FoX", "tHE", 0, true)  );
 +
// Search for non-occurrence of a string
 +
println(  IndexNotOfAny("The quick brown FoX", array("THE"), 0, true)  );
 +
// Search for non-occurrence of array of strings
 +
println(  IndexNotOfAny("The quick brown FoX", array("BROWN ", "ThE ", "Quick "), 0, true)  );
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
[[Category:Core Function]]
 
[[Category:Core Function]]

Latest revision as of 12:37, 14 June 2015

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

Contents

Description

Reports the index of the first none occurrence of any characters or array of strings in a string.

expression

The string to use.

needle

The characters to not find OR an array of strings not 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 first found character in the string that does not match the needle.

Failure: Returns -1.

Remarks

None.

Example

Case sensitive

// Search for non-occurrence of characters
println(   IndexNotOfAny("The quick brown FoX", "The")   );
// Search for non-occurrence of a string
println(   IndexNotOfAny("The quick brown FoX", array("The"))   );
// Search for non-occurrence of array of strings
println(   IndexNotOfAny("The quick brown FoX", array("brown ", "The ", "quick "))   );

Case insensitive

// Search for non-occurrence of characters
println(   IndexNotOfAny("The quick brown FoX", "tHE", 0, true)   );
// Search for non-occurrence of a string
println(   IndexNotOfAny("The quick brown FoX", array("THE"), 0, true)   );
// Search for non-occurrence of array of strings
println(   IndexNotOfAny("The quick brown FoX", array("BROWN ", "ThE ", "Quick "), 0, true)   );
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox