![]() ![]() Second part, we implemented our own method of splitting the string based on delimiter. ![]() Also, we wrote an example program to understand the usage of library function. We took an example use case to understand the library function strtok. The library function which can be used to split the string based on delimiter is strtok. There are already available library ways to do that. So far, we discussed about the Splitting the string based on delimiter. Output from the above program with the same input set as of standard C strtok function:įull String = Bob is studying in Stanford University * * return value of the strtok will be the split string based on delimiter*/ * Consecutive calls to the strtok should be with first parameter as NULL and second parameter as delimiter * First call to search_toekn should be done with string and delimiter as first and second parameter*/ Printf ( "Full String = %s \n" ,string ) If ( (string = NULL ) & (remember = NULL ) )Ĭhar string = "Bob is studying in Stanford University" Char *search_token ( char *string, char *delim ) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |