C cdmwz Unregistered / Unconfirmed GUEST, unregistred user! 2007-05-29 #1 请问,如何将字符串转化成字符数组: 比如: 原始字符串: 'ABCDE' 转换后: 'a','b','c','d','e' 谢谢!
D dennyshao001 Unregistered / Unconfirmed GUEST, unregistred user! 2007-05-29 #2 str:string temp:variant; str:='ABCDE'; temp:= VarArrayCreate([0,5], varstring); temp[1]:=lowercase(copy(str,1,1)); temp[2]:=lowercase(copy(str,2,1)); temp[3]:=lowercase(copy(str,3,1)); temp[4]:=lowercase(copy(str,4,1)); temp[5]:=lowercase(copy(str,5,1));
str:string temp:variant; str:='ABCDE'; temp:= VarArrayCreate([0,5], varstring); temp[1]:=lowercase(copy(str,1,1)); temp[2]:=lowercase(copy(str,2,1)); temp[3]:=lowercase(copy(str,3,1)); temp[4]:=lowercase(copy(str,4,1)); temp[5]:=lowercase(copy(str,5,1));
Y ysai Unregistered / Unconfirmed GUEST, unregistred user! 2007-05-29 #3 var s : string; p : array of char; begin inherited; s := 'abcdefg'; setlength(p, length(s)); copymemory(@p[0], @s[1], length(s)); caption := p[3]; end;
var s : string; p : array of char; begin inherited; s := 'abcdefg'; setlength(p, length(s)); copymemory(@p[0], @s[1], length(s)); caption := p[3]; end;
C cdmwz Unregistered / Unconfirmed GUEST, unregistred user! 2007-05-29 #4 ysai 是正解! 谢谢dennyshao001关注!