E
Exits Funnel
Hello,
I've two quick questions. Suppose I've got the following:
char* cptr = "This is potentially, a really, really long string";
I need to determine if the string contains "PULP FICTION" without regard
to case. For example, all of "PULP FICTION", "pulp fiction", and PuLp
Fiction" meet my criteria. I don't care WHERE in the character array it
occurs, I just want to know if it's there. Is there a standard library
function which will do this for me or do I need to write something
myself? Either something which will handle the char* directly or
somethign in std::string; either would be okay. I've poked around a
fair bit and can't find anyting, but it seems this should be a pretty
common kind of thing to do.
On a related note: If I follow the line above with this:
std::string myString = cptr;
does this involve copying the entire contents of cptr, or does the
automatic myString implement copy on write semantics? I suspect the
former but it couldn't hurt to ask. Thanks in advance for any replies!
-exits
I've two quick questions. Suppose I've got the following:
char* cptr = "This is potentially, a really, really long string";
I need to determine if the string contains "PULP FICTION" without regard
to case. For example, all of "PULP FICTION", "pulp fiction", and PuLp
Fiction" meet my criteria. I don't care WHERE in the character array it
occurs, I just want to know if it's there. Is there a standard library
function which will do this for me or do I need to write something
myself? Either something which will handle the char* directly or
somethign in std::string; either would be okay. I've poked around a
fair bit and can't find anyting, but it seems this should be a pretty
common kind of thing to do.
On a related note: If I follow the line above with this:
std::string myString = cptr;
does this involve copying the entire contents of cptr, or does the
automatic myString implement copy on write semantics? I suspect the
former but it couldn't hurt to ask. Thanks in advance for any replies!
-exits