以下两个是VB中的函数,在Delphi中对应函数是否存在,是什么?1.String 函数示例
本示例使用 String 函数来生成一指定长度,且只含单一字符的字符串。Dim MyString
MyString = String(5, "*")   ' 返回 "*****"。
MyString = String(5, 42)   ' 返回 "*****"。
MyString = String(10, "ABC")   ' 返回 "AAAAAAAAAA"。2.InStr 函数
      返回 Variant (Long),指定一字符串在另一字符串中最先出现的位置。语法 InStr([start, ]string1, string2[, compare])

解决方案 »

  1.   

    Locates the position of a substring within a string.UnitSysUtilsCategorystring handling routinesfunction AnsiPos(const Substr, S: string): Integer;DescriptionCall AnsiPos to obtain the byte offset of the Substr parameter, as it appears in the string S. For example, if Substr is the string 'AB', and S is the string 'ABCDE', AnsiPos returns 1. If Substr does not appear in S, AnsiPos returns 0.Note: This function supports multi-byte character sets (MBCS).
      

  2.   

    1.system单元
      StringOfChar(Ch:Char;Count:Integer):string;
          返回一个指定数量字符的字符串    如:S:=stringofchar('A',10);
            则S为字符串“AAAAAAAAAA”2.system单元
       pos(substr:string;S:string):Integer;
        返回substr子串在S中第一次出现的位置