Index: glib/gstrfuncs.c
===================================================================
RCS file: /cvs/gnome/glib/glib/gstrfuncs.c,v
retrieving revision 1.109
diff -u -r1.109 gstrfuncs.c
--- glib/gstrfuncs.c	27 Jul 2004 06:02:15 -0000	1.109
+++ glib/gstrfuncs.c	18 Aug 2004 14:22:44 -0000
@@ -2696,3 +2696,44 @@
   
   return msgval;
 }
+
+
+
+/**
+ * g_strreplace
+ * @string: a string
+ * @search: search string
+ * @replacement: replacement string
+ * 
+ * Replaces all occurences of @search in a new copy of @string 
+ *   by @replacement.
+ * 
+ * Return value: A newly allocated string, where all @search 
+ *   strings are replaced by the @replacement string.
+ *
+ * Since: 2.6
+ **/
+gchar *
+g_strreplace (const gchar *string,
+              const gchar *search,
+              const gchar *replacement)
+{
+  gchar *str, **arr;
+
+  g_return_val_if_fail (string != NULL, NULL);
+  g_return_val_if_fail (search != NULL, NULL);
+
+  if (replacement == NULL)
+    replacement = "";
+
+  arr = g_strsplit (string, search, -1);
+  if (arr != NULL && arr[0] != NULL)
+    str = g_strjoinv (replacement, arr);
+  else
+    str = g_strdup (string);
+
+  g_strfreev (arr);
+	
+  return str;
+}
+
