Rockbox Technical Forums
Rockbox Development => Starting Development and Compiling => Topic started by: Zeltzer on February 14, 2010, 02:37:13 PM
-
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.
-
if it isn't in the standard C library it's unlikely
-
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.
-
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).