Rockbox Development > Starting Development and Compiling
API: anything to split string into an array exists?
(1/1)
Zeltzer:
Hello, I need to split a st|ri|ng into an array, are there any custom RB routines that I don't need to rewrite? I honestly looked today through the code, but haven't found yet.
Just don't want to add some unnecessary code.
funman:
if it isn't in the standard C library it's unlikely
Zeltzer:
What I'm looking for is a ready Rockbox function that does that, using ANSI C, of course.
I just don't want to add a new one if it already exists and I simply cannot see it.
Something that reads substring|delimiter|substring sequentially.
Domonoky:
There is no function to split it directly to a array in C or rockboxs plugin api.
But you can easily do this yourself with the strtok_r funktion to seperate the string into tokens and then put those token in a array yourself.
(look at normal C strtok documentation on how to use that).
Navigation
[0] Message Index
Go to full version