Fórum String - localizar/pesquisar uma parte da string #565571
09/08/2009
0
George Andre
Curtir tópico
+ 0Posts
09/08/2009
Celso Martins
Gostei + 0
10/08/2009
George Andre
Gostei + 0
10/08/2009
William Siqueira
String str1 = "cnlab02pc27"; String procurada = "lab02"; int pos = str1.indexOf(procurada) + procurada.length(); String pc = str1.substring(pos);
Gostei + 0
12/08/2009
George Andre
InetAddress addr = InetAddress.getLocalHost();
String hostname = addr.getHostName();
for(int i=1; i <= 3; i++ ){
Boolean equals1 = hostname.contains("lab0"+i);
if(equals1==true){
getServletContext().getRequestDispatcher
("/index"+i+".jsp").forward(request, response);
break;
}
}Gostei + 0
13/08/2009
Flávio Mendes
if(string.contais("teste")){
//faz algo
}
Gostei + 0