Re: GLib substr function
- From: Stef Walter <stef-list memberwebs com>
- To: b0unc3 <daniele maio gmail com>
- Cc: gtk-devel-list gnome org
- Subject: Re: GLib substr function
- Date: Fri, 10 Apr 2009 17:45:06 +0000 (UTC)
b0unc3 wrote:
> 2009/4/10 Nelson Benítez León <nbenitezl gmail com>
>> Another way,
>>
>> substring (GString *str, int index, int len)
>> {
>> return g_string_new_len (str->str, index, MIN (str->len - index, len));
>> }
>>
<snip>
>
> First of all thanks to everyone who replayed.
> The implementation using g_srtndup looks ok.
>
> I was wondering why not to add a so simple example in the official docs
> (maybe in the g_strndup explanation).
Maybe because it's completely wrong for UTF-8 strings?
Cheers,
Stef
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]