aboutsummaryrefslogtreecommitdiffstats
path: root/camel/string-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/string-utils.c')
-rw-r--r--camel/string-utils.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/camel/string-utils.c b/camel/string-utils.c
index 42fb93538a..28a4a81a0e 100644
--- a/camel/string-utils.c
+++ b/camel/string-utils.c
@@ -51,11 +51,6 @@ string_list_free (GList *string_list)
g_list_free (string_list);
}
-
-
-
-
-
GList *
string_split (const gchar *string, char sep, const gchar *trim_chars, StringTrimOption trim_options)
{
@@ -91,7 +86,6 @@ string_split (const gchar *string, char sep, const gchar *trim_chars, StringTrim
return result;
}
-
void
string_trim (gchar *string, const gchar *trim_chars, StringTrimOption options)
{
@@ -122,9 +116,6 @@ string_trim (gchar *string, const gchar *trim_chars, StringTrimOption options)
}
-
-
-
/**
* remove_suffix: remove a suffix from a string
* @s: the string to remove the suffix from.
@@ -183,3 +174,24 @@ string_prefix (const gchar *s, const gchar *suffix, gboolean *suffix_found)
return result_string;
}
+
+gchar *
+strstrcase (const gchar *haystack, const gchar *needle)
+{
+ /* find the needle in the haystack neglecting case */
+ gchar *ptr;
+ guint len;
+
+ g_return_val_if_fail (haystack != NULL, NULL);
+ g_return_val_if_fail (needle != NULL, NULL);
+
+ len = strlen(needle);
+ if (len > strlen(haystack))
+ return NULL;
+
+ for (ptr = haystack; *(ptr + len - 1) != '\0'; ptr++)
+ if (!g_strncasecmp(ptr, needle, len))
+ return ptr;
+
+ return NULL;
+}