Jump to content
YOUR-AD-HERE
HOSTING
TOOLS

Locked sSplitDirigido [By Expermicid]


Expermicid

Recommended Posts

Implementado una funcion tipo split del vb6 pero en java.

 

[lenguaje=java]/* Funcion sSplitDirigido

* Autor : Expermicid

* Fecha : 11/10/12

* Modo de uso : sSplitDirigido(Texto,Delimitador,Index)

*/

private static String sSplitDirigido(String sTexto, String Delimitador, int Index) {

 

String apuntado;

int x;

int posicion;

boolean noSalir;

 

apuntado = "";

x = 0;

posicion = 0;

 

noSalir = true;

 

if ((sTexto != "") && (Delimitador != "")) {

while ((sTexto.indexOf(Delimitador, posicion) > 0) && noSalir) {

if (x == Index) {

apuntado = sTexto.substring(posicion, sTexto.indexOf(Delimitador, posicion)) ;

noSalir = false;

}else{

posicion = sTexto.indexOf(Delimitador, posicion) + Delimitador.length() ;

x = x + 1;

}

}

}

return apuntado;

}[/lenguaje]

 

En funcionamiento

 

This is the hidden content, please

 

Saludos

Edited by Expermicid
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.