我有这么一个字符串“aaaa/bbbbbbbb/ccccccccc/ddddddddddd/....../nnnnnnnn”不知如何才能实现截取出“/”后的字符。如上述字符串截取成
aaaa
bbbbbbbb
ccccccccc

急用啊。希望写的稍微详细点。谢谢

解决方案 »

  1.   

    var dd:boolean;
        stl:tstrings;
        str:string;
    dd:=false;
    stl:=tliststring.create;
    for not dd do
    begin
    if pos('/',str)<>0 then
    begin
    dd:=false;
    stl:=copy(str,1,pos('/',str)-1);
    str:=copy(str,pos('/',str),legnt(str)-pos('/',str)-1);
    end else
    dd:=true;
    end;
    用的时候在stl[]去取
      

  2.   

    大哥,你有没有学过程序的啊?
    看看书好不好。。用POS得到“/"的位置
    用COPY 取字符串,用DELETE删除这是最容易想到,也最简单的方法..
      

  3.   

    用copy,pos函数;
    1.查第一个'/'的位置,截取前面的字符串;
    2.后面的作为新的备查串;
    3.循环第一步,直到没有了'/'