H
hying95
Unregistered / Unconfirmed
GUEST, unregistred user!
to lasmai出现新问题了
const
cnXM: Array [0..10] of string=('一二','三四','五六','一二上','一二下','一二左','三四上','三四下','三四左','五六上','五六下');
bArr: Array [0..10] of string=('12','42','36','01','02','03','04','02',
'06','03','06');
{
memo1中的字符列表如下
一二上+三四下+五六左+三四+三四左+三四
一二左+五六下+五六左+三四+三四左+一二
}
用你的最后:三四,一二不能替换,
for i := 0 to High(cnXM) dO
begin
s:=cnXM;
N:=pos(s,s1);
if length(s) = 4 then
begin
if RightStr(s1, 4) = s then s1 := LeftStr(s1, Length(s1) - 4) + bArr;
s1 := StringReplace(s1,s+'+',bArr+'+',[rfReplaceAll]);
end
else
s1 := StringReplace(s1,s,bArr,[rfReplaceAll]);
end;
const
cnXM: Array [0..10] of string=('一二','三四','五六','一二上','一二下','一二左','三四上','三四下','三四左','五六上','五六下');
bArr: Array [0..10] of string=('12','42','36','01','02','03','04','02',
'06','03','06');
{
memo1中的字符列表如下
一二上+三四下+五六左+三四+三四左+三四
一二左+五六下+五六左+三四+三四左+一二
}
用你的最后:三四,一二不能替换,
for i := 0 to High(cnXM) dO
begin
s:=cnXM;
N:=pos(s,s1);
if length(s) = 4 then
begin
if RightStr(s1, 4) = s then s1 := LeftStr(s1, Length(s1) - 4) + bArr;
s1 := StringReplace(s1,s+'+',bArr+'+',[rfReplaceAll]);
end
else
s1 := StringReplace(s1,s,bArr,[rfReplaceAll]);
end;