Re: GLib substr function
- From: Tim-Philipp Müller <t i m zen co uk>
- To: gtk-devel-list gnome org
- Subject: Re: GLib substr function
- Date: Fri, 10 Apr 2009 13:19:39 +0100
On Fri, 2009-04-10 at 12:45 +0200, b0unc3 wrote:
> there is any implementation of a substr function in GLib ?
>
> I mean :
> string = "hello world"
> g_*substr*(string,2,6)
> output = llo w
substr = g_strndup (string + offset, len);
...
g_free (substr);
should do the trick (assuming that offset < strlen).
Cheers
-Tim
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]