Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

QuotedStr - Reversal?

273 views
Skip to first unread message

Frank Russello

unread,
Feb 15, 2001, 11:55:50 AM2/15/01
to
Hi all,
Is there a function that reverses the QuotedStr function?

Thanks
Frank

djcomlab

unread,
Feb 15, 2001, 12:14:34 PM2/15/01
to

Try this:

strX:=stringreplace(strX,'''','',[rfReplaceAll]);


John Elrick

unread,
Feb 15, 2001, 12:19:06 PM2/15/01
to
AnsiExtractQuotedStr

--
John Elrick

Frank Russello

unread,
Feb 15, 2001, 12:22:59 PM2/15/01
to
Thanks,
but that doesn't work when the original string ends in a quote.
Example: MyString := 'ABC''';
MyString := QuotedStr(MyString);
MyString := stringreplace(strX,'''','',[rfReplaceAll]);

Here MyString now = ABC - no trailing quote

Frank

Frank Russello

unread,
Feb 15, 2001, 12:32:40 PM2/15/01
to
Thanks,
I also forget about those "ansi" string functions

Frank

John Elrick wrote:

> AnsiExtractQuotedStr
>
> --
> John Elrick

djcomlab

unread,
Feb 15, 2001, 1:56:03 PM2/15/01
to

Oh, cool! I didn't know about this either! Thanks!

"John Elrick" wrote:
>AnsiExtractQuotedStr

The DeerBear

unread,
Feb 16, 2001, 5:32:49 AM2/16/01
to
What about the StripParamQuotes function?

Andrew
Frank Russello <fr...@habasoft.com> wrote in message
3A8C0A16...@habasoft.com...

lachlan

unread,
Feb 16, 2001, 6:58:18 AM2/16/01
to
"The DeerBear" <rain...@tin.it> wrote in message news:3a8d01f6_1@dnews...


I assume that you are asking for a function that will remove the quote
characters
from each side of a string?


if so..

This function is part of AdvanceStringCore - you are free to use this
code privatly for non commercial application (providing that credit
and a link to www.excommunicant.co.uk is given). For more tools
(included ones I wont give away here !) please wisit our web page
and download the 30 day evaluation version

//*********************************************************************
//*********************************************************************
//** CHOP **
//*********************************************************************
//*********************************************************************
FUNCTION Chop(CONST source:STRING;CONST mask:CHAR):STRING;
{ Version 1.0 Lachlan Fairgrieve 1998

Remove [Mask] Characters from the ends of a string
@@Lach@lan@@@ >>> Lach@lan

Initialise & Validate:
Result
StringLength Counter
That there is a string to work with
Prepare sp
Prepeare ep

Find End of wanted string :
Move ep backwards until it no longer
points to a [mask] character

Find Start of wanted string :
Move sp forwards until it no longer
points to a [mask] character

Produce Result :
The [source] characters between sp and ep

}
VAR
sp, // [Source] Pointer Running from the start
ep:pchar; // [Source] Pointer Running the end
index,
tsl:Integer; // TempStringLength variable
rs:string; // Intermediate Result String
tc:char; // TempChar
BEGIN

//*********************************************
//** INTITIALISE & VALIDATE **
//*********************************************
Result:='';
tsl:=length(source);
if tsl < 1 then exit;
sp:=Pointer(Source);
ep:=sp;
index:=tsl;

//*********************************************
//** FIND THE END OF THE WANTED STRING **
//*********************************************
inc(ep,tsl-1);
while (ep^ = mask) and (index>-1) do
BEGIN
dec(index);
dec(ep);
END;
inc(ep);

//*********************************************
//** FIND THE START OF THE WANTED STRING **
//*********************************************
if index < 1 then exit;
index:=tsl;
while (sp^ = mask) and (index>-1)do
BEGIN
inc(sp);
dec(index);
END;

//********************************************
//** PRODUCE RESULT **
//********************************************
if index<1 then exit;
Result:='';
rs:='';
while sp <> ep do
BEGIN
tc:=sp^;
rs:=rs+tc;
inc(sp);
end;
result:=rs;

END; // of chop


--
lac...@excommunicant.co.uk
AdvanceString - Powerful easy to use
document and string processing tools.
Download the demo at:
www.excommunicant.co.uk


John Herbster

unread,
Feb 16, 2001, 9:38:57 AM2/16/01
to
Lachlan, If you care how your code looks when viewed with
Outlook Express then you might want to insert a blank after
all double slashes. In other words use "// *****". Otherwise,
OE throws the "file:" in automatically. Regards, JohnH

lachlan <lac...@SPAMMEPLENTYexcommunicant.co.uk> wrote

> file://*************************************************** ...
> file://***************************************************
> file://** CHOP
> file://*************************************************** ...
> file://***************************************************

lachlan

unread,
Feb 16, 2001, 9:55:03 AM2/16/01
to
"John Herbster" <jo...@petronworld.com> wrote in message
news:3a8d3c1a_1@dnews...

> Lachlan, If you care how your code looks when viewed with
> Outlook Express then you might want to insert a blank after
> all double slashes. In other words use "// *****". Otherwise,
> OE throws the "file:" in automatically. Regards, JohnH
>
> lachlan <lac...@SPAMMEPLENTYexcommunicant.co.uk> wrote
>
> > file://*************************************************** ...


I really hate that *feature* of outlook express -
When I check the post though it dosent happen - ie it
looked as it should otherwise I would have cancelled the
message and tried again :((((((

Jérôme Tremblay

unread,
Feb 16, 2001, 10:56:48 AM2/16/01
to
> I really hate that *feature* of outlook express -

Don't we all? If life was easy there would be no merit. :)


0 new messages