Jump to content
YOUR-AD-HERE
HOSTING
TOOLS

Locked sSplitDirigido C++ [By Expermicid]


Expermicid

Recommended Posts

Hola a todos. Aqui les dejo esta funcion para esplitear un string xD

 

[lenguaje=cpp]/* Funcion sSplitDirigido

* Autor : Expermicid

* Fecha : 11/11/12

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

*/

const char* sSpliDirigido(char str[], char delimitador[], int elemento) {

int paso = 0;

char * pch = NULL;

char * next_token = NULL;

 

pch = strtok_s (str, delimitador, &next_token);

while ((pch != NULL) && (paso < elemento)) {

pch = strtok_s (NULL, delimitador, &next_token);

paso += 1;

}

 

return pch;

}[/lenguaje]

 

Es como el que hice para delphi y java, se le pasa el String, el Delimitador y el Index del elemento que se quiere.

 

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.