Re: subset function for string in c++



"puzzlecracker" <ironsel2000@xxxxxxxxx> writes:

> basically, I need to find out wether charecters in string a are subset
> of string b..
>
> example
>
> a: rx b:rwx
> that shall return true.

/* Returns true if A is a subset of B, false otherwise. */
bool
is_subset (const char *a, const char *b) {
return a[strspn (a, b)] == '\0';
}
--
"Writing is easy.
All you do is sit in front of a typewriter and open a vein."
--Walter Smith
.



Relevant Pages