IndexOf Command

From GeoGebra Manual
Revision as of 21:16, 9 March 2013 by Zbynek (talk | contribs) (Text replace - "<div class="box info"> 48px|left This page is part of the official manual for print and pdf. For structural reasons normal users can't edit this page. If you found any errors on this page please contact )
Jump to: navigation, search



IndexOf[ <Object>, <List> ]
Returns position of first occurrence of Object in List, e.g. IndexOf[5, {1, 3, 5, 2, 5, 4}] returns 3. When the object is not found, result is undefined.
IndexOf[ <Object>, <List>, <Start Index> ]
Same as above, but the search starts at given index.
Examples:
  • IndexOf[5, {1, 3, 5, 2, 5, 4}, 3] returns 3.
  • IndexOf[5, {1, 3, 5, 2, 5, 4}, 4] returns 5.
  • IndexOf[5, {1, 3, 5, 2, 5, 4}, 6] returns undefined.
IndexOf[ <Text Needle>, <Text Haystack>]
Returns position of first occurrence of Needle in Haystack, e.g. IndexOf["Ge", "GeoGebra"] returns 1.
IndexOf[ <Text Needle>, <Text Haystack>, <Start Index> ]
Same as above, but the search starts at given index.
Example: IndexOf["Ge", "GeoGebra",2] returns 4.
© 2024 International GeoGebra Institute