功能像fox里面的 
1问题:我想知道在delphi 中有类似于fox 中的subst的函数吗~?
       \     fox      delphi 
             subs()        ?
   
2问题:\   我想在字符里安内容来分子符串 比方说两个字符 1、aaaa张三ddddddd
2、aa张三dddd分割取出后能成为  1能变为 aaaa张三   2能变为  aa张三  注意: a的个数不同,
也就是以张三为界线取出之前或是之后的数据
我不知道我上面的想法说清楚了没有大家那个能帮我的,请赐教呀~~
                      谢谢 ~~
               第一个: 40分   第二个: 60分~
   谢谢  
   

解决方案 »

  1.   

    1、
    Pos,AnsiPos用来得到子串的位置!!!Copy用来复制子串!!!Delete用来删除子串!!!
    2、
      iPos := AnsiPos( '张三', Str );
      Resultstr := Copy( Str, 1, iPos + 4 );
         
      

  2.   

    1
    Copy()
    2
    LeftStr与RightStr(D6以上)
      

  3.   

    给你一些Delphi的字符串处理函数AnsiContainsStr functionIndicates whether one string is a (case-sensitive) substring of another.AnsiContainsText functionIndicates whether one string is a (case-insensitive) substring of another.AnsiEndsStr functionIndicates whether one string is a (case-sensitive) suffix of another.AnsiEndsText functionIndicates whether one string is a (case-insensitive) suffix of another.AnsiIndexStr functionProvides the index of a specified string in an array of strings.AnsiIndexText functionProvides the index of a specified string in an array of strings.AnsiLeftStr functionReturns the substring of a specified length that appears at the start of a string.AnsiMatchStr functionIndicates whether an array of strings contains an exact match to a specified string.AnsiMatchText functionIndicates whether an array of strings contains a case-insensitive match to a specified string.AnsiMidStr functionReturns the substring of a specified length that appears at a specified position in a string.AnsiReplaceStr functionReplaces all occurrences of a substring with another string.AnsiReplaceText functionReplaces all case-insensitive matches of a substring with another string.AnsiResemblesProc variableControls the algorithm used by AnsiResemblesText to determine when two strings are similar.AnsiResemblesText functionIndicates whether two strings are similar.AnsiReverseString functionReturns reversed string.AnsiRightStr functionReturns the substring of a specified length that appears at the end of a string.AnsiStartsStr functionIndicates whether one string is a (case-sensitive) prefix of another.AnsiStartsText functionIndicates whether one string is a (case-insensitive) prefix of another.DecodeSoundExInt functionConverts an integer representation of a SoundEx encoding into the corresponding phonetic string.DecodeSoundExWord functionConverts a Word representation of a SoundEx encoding into the corresponding phonetic string.DupeString functionReturns the concatenation of a string with itself a specified number of repeats.LeftBStr functionReturns the substring of a specified number of bytes that appears at the start of a string.LeftStr functionReturns the substring of a specified length that appears at the start of a string.MidBStr functionReturns the substring of a specified number of bytes that appears at a specified position in a string.MidStr functionReturns the substring of a specified length that appears at a specified position in a string.PosEx functionReturns the index value of a substring.ReverseString functionReturns the reverse of a specified string.RightBStr functionReturns the substring of a specified number of bytes that appears at the end of a string.RightStr functionReturns the substring of a specified length that appears at the end of a string.SearchBuf functionLocates a substring within a text buffer.SoundEx functionConverts a string into its SoundEx representation.SoundExCompare functionCompares the SoundEx representations of two strings.SoundExInt functionConverts a string into an integer that represents its phonetic value.SoundExProc functionIndicates whether two strings are similar.SoundExSimilar functionIndicates whether two strings are similar.SoundExWord functionConverts a string into a Word that represents its phonetic value.StuffString functionInserts a substring into a specified position of a string, replacing the current characters.
      

  4.   

    授人以鱼不如授人以渔,多看看Delphi自带的帮助吧,虽然感觉比MSDN略逊,也是别有所长啊
      

  5.   

    1﹑copy(原字符串﹐起始位置﹐個數)。
       delete(原字符串﹐起始位置﹐個數)。
    2﹑I:= Pos('张三',Str);
      str:=copy(str,1,I+4);
      

  6.   

    谢谢大家~~
    现在2:30,我才上班呢, dwgz() 我当然要结账了~~ 
    哈哈~~ 大家太热情了,感动的流泪了~