IndexOf 指令
来自GeoGebra Manual
本页为官方文件,一般使用者无法修改,若有任何误谬,请与官方联络。如欲编辑,请至本页的开放版。
- IndexOf[ <Object>, <List> ]
- IndexOf[ <Object>, <List>, <Start Index> ]
- IndexOf[ <Text>, <Text>]
- IndexOf[ <Text>, <Text>, <Start Index> ]
- 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.
范例:
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.
范例:
IndexOf["Ge","GeoGebra",2]
returns 4.