October 2004
Intermediate to advanced
336 pages
6h 27m
English
This function parses a string into substrings delimited by a specified character. The function takes as input a string, a delimiter, and an index. It splits the string into substrings that are separated by the delimiter, and returns the appropriate substring based on the index, where the first substring would be indexed as 1, the second as 2, and so on.
For example, with an input string "This#is#a#test" and a delimiter of '#', index 2 would point to the substring "is". (C strings are just arrays of type char; normally, the end of a string is marked by having a character with value 0, also written as '\0', but in ...
Read now
Unlock full access