将字符串变量中的指定字符串删除,如从字符串变量('a','b','c','d','等','未知')删除'c',不知道在变量的位置

解决方案 »

  1.   

    Returns a string with occurrences of one substring replaced by another substring.UnitSysUtilsCategorystring handling routinesDelphi syntax:function StringReplace(const S, OldPattern, NewPattern: string; Flags: TReplaceFlags): string;C++ syntax:extern PACKAGE AnsiString __fastcall StringReplace(const AnsiString S, const AnsiString OldPattern, const AnsiString NewPattern, TReplaceFlags Flags);DescriptionStringReplace replaces occurrences of the substring specified by OldPattern with the substring specified by NewPattern. StringReplace assumes that the source string may contain Multibyte characters.S is the source string, whose substrings are changed.OldPattern is the substring to locate and replace with NewPattern.NewPattern is the substring to substitute for occurrences of OldPattern.Flags is a set of flags that govern how StringReplace locates and replaces occurrences of OldPattern. If Flags does not include rfReplaceAll, StringReplace only replaces the first occurrence of OldPattern in S. Otherwise, StringReplace replaces all instances of OldPattern with NewPattern. If the Flags parameter includes rfIgnoreCase, The comparison operation is case insensitive.
      

  2.   

    同意楼上的
    StringReplace(str,'c','',[rfReplaceAll]);