Difference between revisions of "IndexOf"

From MiniScript Wiki
Jump to navigation Jump to search
m (JoeStrout moved page Indexof to IndexOf without leaving a redirect)
m
 
Line 1: Line 1:
<c>indexOf</c> returns index or key of the given value, or if not found.
+
<c>indexOf</c> returns index or key of the given value, or [[null]] if not found.
  
 
=== Arguments ===
 
=== Arguments ===

Latest revision as of 15:20, 27 May 2022

indexOf returns index or key of the given value, or null if not found.

Arguments

Parameter Name Default Value Meaning
self string, list, or map object to search
value any value to search for
after any, optional if given, starts the search after this index

Examples

"Hello World".indexOf("o")		// returns 4
"Hello World".indexOf("o", 4)		// returns 7
"Hello World".indexOf("o", 7)		// returns null