Guest:
Register
|
Login
|
Member List
|
Search
|
Statistics
|
FAQ
Language
----------
Simplifed Chinese
Traditional Chinese
English
CnPack Forum
»
CnPack IDE 专家包(CnWizards)
» DELPHI或CNPACK有没有这样现成的函数?
‹‹ Last Thread
|
Next Thread ››
Poll
Trade
Reward
Activity
Printable Version
|
Email to Friend
|
Subscription
|
Favorites
Subject: DELPHI或CNPACK有没有这样现成的函数?
wiseinfo
灌水科科长
UID 560
Digest Posts 0
Credits 159
Posts 80
点点分 159
Reading Access 10
Registered 2004-11-11
Status Offline
#1
Post at 2011-3-30 15:57
Profile
|
Blog
|
P.M.
DELPHI或CNPACK有没有这样现成的函数?
类似DELPHI DFM文件中,ORD可以对单个处理, 想知道有没有现成的?
CHINA和谐中国 转换成右边的 'CHINA'#21644#35856#20013#22269
[
本帖最后由 wiseinfo 于 2011-3-30 15:59 编辑
]
wiseinfo
灌水科科长
UID 560
Digest Posts 0
Credits 159
Posts 80
点点分 159
Reading Access 10
Registered 2004-11-11
Status Offline
#2
Post at 2011-3-30 16:26
Profile
|
Blog
|
P.M.
从Classes.pas抄了一个
function StringConvert(S: string): string;
var
L, I, J: Integer;
begin
Result := EmptyStr;
L := Length(S);
if L = 0 then
Exit;
I := 1;
repeat
if (S[I] >= ' ') and (S[I] <> '''') and (Ord(S
) <= 127) then
begin
J := I;
repeat
Inc(I)
until (I > L) or (S[I] < ' ') or (S[I] = '''') or (Ord(S
) > 127);
Result := Result + '''';
while J < I do
begin
Result := Result + string(AnsiChar(S[J]));
Inc(J);
end;
Result := Result + '''';
end
else
begin
Result := Result + '#' + IntToStr(Ord(S[I]));
Inc(I);
end;
until I > L;
end;
Poll
Trade
Reward
Activity
CnPack Forum
CnPack English Forum
> CnWizards IDE Wizards
> CVSTracNT
> Announcements & Others
All times are GMT++8, the time now is 2024-11-25 05:48
Powered by
Discuz!
5.0.0
© 2001-2006
Comsenz Inc.
Processed in 0.007856 second(s), 7 queries , Gzip enabled
TOP
Clear Cookies
-
Contact Us
-
CnPack Website
-
Archiver
-
WAP
Member's CP Home
Edit Profile
Credits Transaction
Public User Groups
Buddy List
Main
Page Views
User Agents
Posts History
Top Forums
Top Threads
Post Ranking
Credit Ranking
Online Time
Team
Moderation Stats