T tripleh Unregistered / Unconfirmed GUEST, unregistred user! 2006-09-05 #1 一个字符串由A-B组成的。中间由-连接,A和B的长度不定。那么怎么从这个字符串中取出A和B?
Z zywcd Unregistered / Unconfirmed GUEST, unregistred user! 2006-09-05 #2 使用pos. tstr:='A-B'; tstr1:=copy(tstr,1,pos('-',tstr)-1);//取出-之前的A tstr2:=copy(tstr,pos('-',tstr)+1,length(tstr));//取出-之后的B
使用pos. tstr:='A-B'; tstr1:=copy(tstr,1,pos('-',tstr)-1);//取出-之前的A tstr2:=copy(tstr,pos('-',tstr)+1,length(tstr));//取出-之后的B
K kaida Unregistered / Unconfirmed GUEST, unregistred user! 2006-09-05 #4 tstr:='A-B'; tstr1:=copy(tstr,1,pos('-',tstr)-1);//取出-之前的A tstr2:=copy(tstr,pos('-',tstr)+1,length(tstr)[red]-pos('-',tstr)[/red]);//取出-之后的B
tstr:='A-B'; tstr1:=copy(tstr,1,pos('-',tstr)-1);//取出-之前的A tstr2:=copy(tstr,pos('-',tstr)+1,length(tstr)[red]-pos('-',tstr)[/red]);//取出-之后的B