string manipulation question
Kenneth Brody
kenbrody at bestweb.net
Fri Dec 10 17:11:51 PST 2004
Robert Haussmann wrote:
>
> I'm sure there is probably a very easy way to do the
> following, but it eludes me at the moment. How
> can I take a string, and replace every instance of
> one character (a single quotation mark) with two
> characters (two single quotes)?
>
> In other words:
> O'Brian becomes O''Brian
> O'Brian's becomes O''Brian''s
As long as you don't want to computer two quotes into four, use the
following edit:
{ {!" "!}@ | "'"<"'"> | * }
This will convert one single-quote into two, and it will leave two
single-quotes as two.
--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody/at\spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <mailto:ThisIsASpamTrap at gmail.com>
More information about the Filepro-list
mailing list