Ver Mensaje Individual
  #3 (permalink)  
Antiguo 12/07/2005, 19:08
Avatar de Modern_Crusades
Modern_Crusades
 
Fecha de Ingreso: junio-2005
Mensajes: 620
Antigüedad: 18 años, 10 meses
Puntos: 1
abstract class sca
{
public static int lineas=0;
public static boolean fin=false;
public static String binario;
public static String[] adet(String tex)
{

String[] tok;
int con=0;
lineas=0;
if(tex.length()<5)
return null;
if((tex.charAt(tex.length()-1)!='\n'))
tex=tex+'\n';
for(int i=0;i<tex.length();i++)
if(tex.charAt(i)=='.')
lineas++;
tok=new String[lineas];
for(int i=0;i<tex.length();i++)
{
if(tex.charAt(i)!='\n')
{
if(tex.charAt(i)!='&')
{
if(tok[con]==null)
tok[con]=""+tex.charAt(i);
else
tok[con]=tok[con]+tex.charAt(i);

}
else
{

con=con+1;


}
}

}

return tok;
}

}
este codigo recibe un string y lo separa en un arrglo dejando en cada linea todo lo que va antes de un & ignorando los espacios.