+ return xbt_str_ltrim(xbt_str_rtrim(s,char_list),char_list);
+}
+
+/** @brief Replace double whitespaces (but no other characters) from the string.
+ *
+ * The function modifies the string so that each time that several spaces appear,
+ * they are replaced by a single space. It will only do so for spaces (ASCII 32, 0x20).
+ *
+ * @param s The string to strip. Modified in place.
+ *
+ */
+void
+xbt_str_strip_spaces(char *s) {
+ char *p = s;
+ int e = 0;
+
+ if (!s)
+ return;
+
+ while (1) {
+ if (!*p)
+ goto end;
+
+ if (*p != ' ')
+ break;
+
+ p++;
+ }
+
+ e = 1;
+
+ do {
+ if (e)
+ *s++ = *p;
+
+ if (!*++p)
+ goto end;
+
+ if (e ^ (*p!=' '))
+ if ((e = !e))
+ *s++ = ' ';
+ } while (1);
+
+ end:
+ *s = '\0';