Reference for the BALTENSPERGER programming language, an art project of Stefan Baltensperger

Class

Satz

Name

indexOf()

Examples
Satz str = "CCCP";
Ganzizahl p1 = str.indexOf("C");
Ganzizahl p2 = str.indexOf("P");
Ganzizahl p3 = str.indexOf("CP");
schrib_uf_e_neui_Linie(p1 + ":" + p2 + ":" + p3);  // Prints '0:3:2'
Description Tests to see if a substring is embedded in a string and returns the index position of the first occurance of the substring defined in the str parameter. If the str parameter is not found in the string, -1 is returned.
Syntax
indexOf(str)
indexOf(str, fromIndex)
Parameters
str Satz: the substring to search
fromIndex Ganzizahl: the index from which to start the search
Usage Web & Application
Stefan Baltensperger 2009

Creative Commons License