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

Trim function in Delphi

73 views
Skip to first unread message

VT Venkatesh

unread,
Jul 25, 2008, 9:00:31 AM7/25/08
to
When i try (searchword is of type string)
***********************************************************
searchWord := searchWord.Trim(['?', '\"', ',', '\''', ';', ':', '.',
'(', ')']).ToLower;
************************************************
I get an error
[DCC Error] Searcharoo.Net.pas(92): E2250 There is no overloaded version
of 'Trim' that can be called with these arguments
I think both '\"' & '\''' are creatng the problem.


(I am trying to convert from C#.The c# syntax is
searchWord = searchWord.Trim('?','\"', ',', '\'', ';', ':', '.', '(',
')').ToLower();
)

What is the correct syntax ?
venkatesh

Stephen Boyd

unread,
Jul 25, 2008, 9:27:17 AM7/25/08
to

I think that you want to eliminate the backslash from '\"' and '\'''

Marc Rohloff [TeamB]

unread,
Jul 25, 2008, 9:42:24 AM7/25/08
to
On Fri, 25 Jul 2008 18:30:31 +0530, VT Venkatesh wrote:

> (I am trying to convert from C#.The c# syntax is
> searchWord = searchWord.Trim('?','\"', ',', '\'', ';', ':', '.', '(',
> ')').ToLower();
> )
>
> What is the correct syntax ?

Delphi doesn't use a \ as a string escape. "\"" should become '"' and
'\'' should become '''' (four single quotes).

--
Marc Rohloff [TeamB]
marc -at- marc rohloff -dot- com

Robert Giesecke

unread,
Jul 25, 2008, 1:58:24 PM7/25/08
to
VT Venkatesh wrote:
>
> (I am trying to convert from C#.The c# syntax is
> searchWord = searchWord.Trim('?','\"', ',', '\'', ';', ':', '.', '(',
> ')').ToLower();
> )
>
> What is the correct syntax ?
> venkatesh


searchWord := searchWord.Trim(['?', #34, ',', #39, ';', ':', '.', '(', ')']).ToLower();

0 new messages