比如下列字符集中,
我现在需要那两个单引号之间的字符串.
4 11 105
3 12 1000
3 13 Hostname: 'YIBO-26'
3 14
3 15
2 3
3 4 ADMINISTRATOR
3 5
4 6 32
我现在需要那两个单引号之间的字符串.
4 11 105
3 12 1000
3 13 Hostname: 'YIBO-26'
3 14
3 15
2 3
3 4 ADMINISTRATOR
3 5
4 6 32
调试欢乐多
var
intA, intB:integer;
strA, strB:WideString;
begin
strA := '4 11 105
3 12 1000
3 13 Hostname: 'YIBO-26'
3 14
3 15
2 3
3 4 ADMINISTRATOR
3 5
4 6 32';
intA := Pos('''',strA);
Delete(strA, intA, 1);
intB := Pos('''',strA) - intA;
strB := Copy(strA, intA, intB);
end;
var
P, S: PChar;
begin
P := PChar(Source);
while True do
begin
if P^ = FilterChar then
begin
Inc(P);
S := P;
while P^ <> FilterChar do Inc(P);
SetString(Result, S, P - S);
break;
end else
if P^ = #0 then
break
else
Inc(P);
end;
end;procedure TForm1.Button1Click(Sender: TObject);
begin
Caption := GetString('aaaaaa''test msg''bbbbbb', '''');
end;
直接写delphi不认识啊!
直接写Delphi怎么不认啊,应该这样写'''''
直接写Delphi怎么不认啊,应该这样写''''。
上面的写错了