FAQ
 
 
Cover  \ Exhibition  \ Learning  \ Reference  \ Download  \ Discourse   
      Linguagem \ Ambiente \ Bibliotecas \ Comparação
 
   
   
Back  
   
  Referência para Processing (BETA) version 91+. Se você tem uma versão anterior, utilize a documentação inclusa em seu software. Se você encontrar quaisquer erros ou tiver quaisquer comentários, leve ao nosso conhecimento.  
Class   String
   
Nome  

indexOf()

   
Exemplos  
String str = "CCCP"; 
int p1 = str.indexOf("C"); 
int p2 = str.indexOf("P"); 
int p3 = str.indexOf("CP"); 
println(p1 + ":" + p2 + ":" + p3);  // Prints '0:3:2' 

Descrição   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.
   
Sintaxe  
indexOf(str)
indexOf(str, fromIndex)
   
Parâmetros  
str   String: the substring to search

fromIndex   int: the index from which to start the search

   
Retorno   int
   
Utilização   Web & Applicações
   
 
 






   
 
Original em inglês atualizado em: Fri Jul 15 16:36:11 PDT 2005
Tradução para o Português do Brasil: Luiz Ernesto Merkle
Atuallizada em: 30 de novembro de 2005, 9h00 (BRST)
 
 








Creative Commons License
 
  Processing é um projeto aberto iniciado por Ben Fry e Casey Reas  
  © Info