Re: [GLib] How to get substrings?
- From: "Hubert Sokolowski" <h sokolowski wsisiz edu pl>
- To: Daniel Miralles García <namarie oasi upc es>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: [GLib] How to get substrings?
- Date: Mon, 8 Nov 2004 13:03:09 +0100 (CET)
Hi!
Hi, dudes!
I'm porting my old-style char* to gchar* (due to some SF's that appear
when I dont't printf("")).
I've been looking a few here and there, but found no function to get a
substring (I mean, from a string, get a substring between two characters
or even two positions). For instance:
Origin = "ABCDEFGH"
my_str = g_get_substring_beteen (origin, "D", "G");
and then my_str=="EF"
I though making it, but I need some "look a character" function:
char mychar = g_get_char (origin, position);
there are functions strchr and strrchr that might help you, but be carefull
with NULLs
or something like this...
...and then maybe appending a character to a string?
origin = g_strdup("hell");
g_string_append_char (origin, "o");
just to have origin -> "hello"...
Any function in GLIB to do that?
hs
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]