Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  API: anything to split string into an array exists?
« previous next »
  • Print
Pages: [1]

Author Topic: API: anything to split string into an array exists?  (Read 1386 times)

Offline Zeltzer

  • Member
  • *
  • Posts: 6
API: anything to split string into an array exists?
« 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.
Logged

Offline funman

  • Developer
  • Member
  • *
  • Posts: 645
Re: API: anything to split string into an array exists?
« Reply #1 on: February 14, 2010, 04:05:34 PM »
if it isn't in the standard C library it's unlikely
Logged
a wise man said: "a wise man said"

Offline Zeltzer

  • Member
  • *
  • Posts: 6
Re: API: anything to split string into an array exists?
« Reply #2 on: February 14, 2010, 05:14:56 PM »
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.
« Last Edit: February 14, 2010, 05:16:54 PM by Zeltzer »
Logged

Offline Domonoky

  • Developer
  • Member
  • *
  • Posts: 205
Re: API: anything to split string into an array exists?
« Reply #3 on: February 14, 2010, 05:34:10 PM »

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).
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  API: anything to split string into an array exists?
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.072 seconds with 15 queries.