GNOME Bugzilla – Bug 109286
GString APIs for substring and replace wanted.
Last modified: 2004-12-22 21:47:04 UTC
Package: glib Severity: enhancement Version: 2.2.1 Synopsis: GString APIs for substring and replace wanted. Bugzilla-Product: glib Bugzilla-Component: general Description: http://sourceforge.net/docman/display_doc.php?docid=16145&group_id=51905 append, insert, and delete fulfilled by corresponding APIs of GString; append, insert, and erase. but GString has no API for substring and replace, yet. what about to make those APIs? ------- Bug moved to this database by unknown@bugzilla.gnome.org 2003-03-26 15:31 ------- Reassigning to the default owner of the component, gtkdev@gtk.org.
replace() could be implemented with sequence of erase() and insert(). but I have no idea what is the best way to implement substring() yet.
Substring is trivial to do as: substring (GString *str, int index, int len) { return g_string_new_len (str->str, index, MIN (str->len - index, len)); }