谁能告诉我判断字符串 abcde//reqw 中的//是在引号中还是在引号外的算法
统计一下查找到//之前的字符()的个数是奇数(引号中)还是偶数(引号外).
procedure TForm1.Button1Click(Sender TObject);
var
Location: PChar;
begin
if StrPos(PChar(Edit1.Text), PChar(Edit2.Text)) <> nil
then
ShowMessage(Substring found)
else
ShowMessage(Substring not found);
end;
你可以試試用判斷 號的奇偶數的方法.
aaa:=abcde++//++reqw;
if pos(+//+,aaa)>0 then//说明存在,否则在外了
你先得把问题说清楚
会不会出现如下情况要求判断?
abcdrew//fda//ab//jkl