List Info

Thread: Re: extracting the n'th character of a widestring




Re: extracting the n'th character of a widestring
user name
2007-01-25 07:36:07

Bob,

Thank you for your reply.

No, I can not predict what unicode characters woudl apss; i have to convert characters one by one and export them in a format Result + '&#x' + IntToHex(AWidechar, 4) + ';';

Doing this to my variable Value = '€' will result in the hex value x8364 while it should be x0080.

so, i'm still looking for a solution to extract the n'th character of a widestring

groetjes
Andries

----- Original Message ----
From: Bob Swart < drbob%40chello.nl">drbobchello.nl>
To: delphi-en%40yahoogroups.com">delphi-enyahoogroups.com
Sent: Thursday, January 25, 2007 1:44:08 PM
Subject: Re: [delphi-en] extracting the n'th character of a widestring

Hi Andries,

> var
> Value : widestring;
> begin
&gt; Value = '€';
>;
> examining this example will result in:
>
> Value = '€' > TRUE
>; but
> Value[1] = '€' FALSE

If you need to know it's at a certain position (like 1), I always do:

if Pos('€',Value) = 1 then ...

Which works just fine with WideStrings as well.

> Andries
> The Netherlands

Groetjes,
Bob Swart

--
Bob Swart Training & Consultancy (eBob42.com) Forever Loyal to Delphi
Blog: http://www.drbob42.com/blog - RSS: http://drbob42.com/weblog.xml
New Delphi 2006 Courseware e-books at http://www.eBob42.com/courseware

-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: delphi-en-unsubscribe%40yahoogroups.com">delphi-en-unsubscribeyahoogroups.com
Yahoo! Groups Links

__________________________________________________________
Bored stiff? Loosen up...
Download and play hundreds of games for free on Yahoo! Games.
http://games.yahoo.com/games/front

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )