string manipulation question

Tony Ryder tryder at westnet.com.au
Fri Dec 10 19:18:12 PST 2004


-----Original Message-----
From: filepro-list-bounces at lists.celestial.com
[mailto:filepro-list-bounces at lists.celestial.com] On Behalf Of Kenneth
Brody
Sent: Saturday, 11 December 2004 11:12 AM
To: Robert Haussmann
Cc: filepro-list at seaslug.org
Subject: Re: string manipulation question


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> |
+-------------------------+--------------------+------------------------
-----+

I do not understand what the @ sign does in this edit.

Tony Ryder



More information about the Filepro-list mailing list