TStringList

list.Add('aa=11');

list.Add('bb=22');

list.Add('cc=33');

for i:=0 to list.Count-1 do

begin

ShowMessage( list.Names[i]+','+list.Values[list.Names[i]] );

end;

E:\测试文件\后台\frmHelp\CPCBom.pas(162):  WhereStr := ' WHERE (IsNull(g.IsStopSale, 0) <> 1) '; 

截取文件名

什么鬼

procedure TForm1.Button1Click(Sender: TObject);

var

i,j,index:integer;

strText,strText2: WideString;

list: TStringList;

begin

list := TStringList.Create;

//去重复

list.Sorted := True;

list.Duplicates := dupIgnore;

try

for i:=0 to Memo1.Lines.Count-1 do

begin

strText := Memo1.Lines.Strings[i];

index := Pos('(',strText);

strText := LeftStr(strText, index-1);

//      list.Add(strText);

//反转

strText2 := ReverseString(strText);

index := Pos('\',strText2);

strText := RightStr(strText,index-1);

list.Add(strText);

end;

Memo1.Lines.Clear;

Memo1.Lines.AddStrings(list);

finally

list.Free;

end;

end;

你可能感兴趣的:(TStringList)