Expermicid Posted October 11, 2012 Share Posted October 11, 2012 (edited) 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 Sign In or Sign Up Saludos Edited February 16, 2014 by Expermicid Link to comment Share on other sites More sharing options...
Recommended Posts