截取字符串sth(如 name:dlx;)里:ch1(如 : )之后ch2(如 ; )之前的子字符串
AnsiString Cut_String(AnsiString sth,char ch1,char ch2)
{
int lgth,lg1,lg2;
AnsiString full_sth;
char pch1,pch2;
full_sth=sth;
pch1=ch1;
pch2=ch2;
lgth= full_sth.Length();
char *P=full_sth.c_str();
for(int i=0;i<lgth;i++)
{
if(P[i]==pch1)
{
lg1=i+2;
}
if(P[i]==pch2)
{
lg2=i+2;
}
}
return full_sth.SubString(lg1,(lg2-lg1-1));
}