StrOps::Sub( StrPtr &, char, char )
Substitute instances of one character for another.
Virtual? |
No |
|
Class |
||
Arguments |
|
the string on which to operate |
|
the target character |
|
|
the character with which to replace |
|
Returns |
|
Notes
This function substitutes the replace
character for every
instance of the target
character in the input
string
. The substitution is performed in place.
Example
#include <stdhdrs.h> #include <strbuf.h> #include <strops.h> int main( int argc, char **argv ) { StrBuf sb; sb.Set( "\tPassword" ); StrOps::Sub( sb, 'o', '0' ); StrOps::Sub( sb, 'a', '4' ); StrOps::Dump( sb ); return 0; }
Executing the preceding code produces the following output:
P4ssw0rd