--- /dev/null
+//Compile with:
+//gcc -Wall -o eina_str_01 eina_str_01.c `pkg-config --cflags --libs eina`
+
+#include <stdio.h>
+#include <Eina.h>
+
+int main(int argc, char **argv)
+{
+ char *names = "Calvin;Leoben;D'anna;Simon;Doral;Six;Daniel;Sharon";
+ char *str;
+ char *prologue;
+ char *part1 = "The Cylons were created by man. They evolved. They rebelled.";
+ char *part2 = "There are many copies. And they have a plan.";
+ char **arr;
+ int i;
+
+ eina_init();
+
+ arr = eina_str_split(names, ";", 0);
+ for (i = 0; arr[i]; i++)
+ printf("%s\n", arr[i]);
+
+ str = malloc(sizeof(char) * 4);
+ sprintf(str, "%s", "bsg");
+
+ eina_str_toupper((char **)&str);
+ printf("%s\n", str);
+ eina_str_tolower(&str);
+ printf("%s\n", str);
+
+ if (eina_str_has_prefix(names, "Calvin"))
+ printf("Starts with 'Calvin'\n");
+ if (eina_str_has_suffix(names, "sharon"))
+ printf("Ends with 'sharon'\n");
+ if (eina_str_has_extension(names, "sharon"))
+ printf("Has extension 'sharon'\n");
+
+ printf("%s\n", eina_str_escape("They'll start going ripe on us pretty soon."));
+
+ prologue = malloc(sizeof(char) * 106);
+ eina_str_join_len(prologue, 106, ' ', part1, strlen(part1), part2, strlen(part2));
+ printf("%s\n", prologue);
+
+ eina_strlcpy(str, prologue, 4);
+ printf("%s\n", str);
+
+ free(prologue);
+ free(str);
+
+ str = malloc(sizeof(char) * 14);
+ sprintf(str, "%s", "cylons+");
+ eina_strlcat(str, "humans", 14);
+ printf("%s\n", str);
+
+ eina_shutdown();
+
+ return 0;
+}
#include "eina_types.h"
/**
+ * @page tutorial_eina_string Eina String example
+ * @dontinclude eina_str_01.c
+ *
+ * Whenever using eina we need to include it:
+ * @skipline #include
+ * @line #include
+ *
+ * In our main function we declare(and initialize) some variables and initialize
+ * eina:
+ * @until eina_init
+ *
+ * It's frequentely nescessary to split a string into it's constituent parts,
+ * eina_str_split() make's it easy to do so:
+ * @until printf
+ *
+ * Another common need is to make a string uppercase or lowercase, so let's
+ * create a string and make it uppercase and then make it lowercase again:
+ * @until printf
+ * @until printf
+ *
+ * Next we use eina to check if our @p names string starts or ends with some
+ * values:
+ * @until Has
+ *
+ * When strings will be used in a terminal(or a number of other places) it
+ * nescessary to escape certain characters that appear in them:
+ * @until printf
+ *
+ * Much as we previously split a string we will now join two strings:
+ * @until printf
+ *
+ * With strlcpy() we can copy what portion of the @p prologue fits in @p str and
+ * be sure that it's still NULL terminated:
+ * @until printf
+ *
+ * Since we are done with @p prologue and @p str we should free them:
+ * @until free(str
+ *
+ * Finally we see strlcat in action:
+ * @until printf("
+ *
+ * And then shut eina down and exit:
+ * @until }
+ * @example eina_str_01.c
+ */
+/**
* @addtogroup Eina_String_Group String
*
* @brief These functions provide useful C string management.
/**
* @addtogroup Eina_Tools_Group Tools
*
+ * For more information refer to the @ref tutorial_eina_string "string example".
+ *
* @{
*/