+
+/* Returns the index of the first character in ST which
+ is an element of the set CS.
+ Returns -1 if no characters are found.
+*/
+int
+ds_find(const struct string *st, const char cs[])
+{
+ int i;
+ int j;
+ for(i = 0; i < st->length ; ++i)
+ {
+ if ('\0' == st->string[i])
+ break;
+ for (j = 0 ; j < strlen(cs) ; ++j)
+ {
+ if ( st->string[i] == cs[j])
+ return i;
+ }
+ }
+ return -1;
+}
+
+/* Returns the index of the first character in ST which
+ is NOT an element of the set CS.
+ Returns -1 if no such character is found.
+*/
+int
+ds_n_find(const struct string *st, const char cs[])
+{
+ int i;
+ int j;
+ for(i = 0; i < st->length ; ++i)
+ {
+ bool found = false;
+ if ('\0' == st->string[i])
+ break;
+ for (j = 0 ; j < strlen(cs) ; ++j)
+ {
+ if ( st->string[i] == cs[j])
+ {
+ found = true;
+ break;
+ }
+ }
+ if ( !found )
+ return i;
+ }
+ return -1;
+}
+
+
+