Re: Fastcode AnsiStringReplace



Hi

I would like somebody to write a comment about the differences between
StringReplace and our AnsiStringReplace.

The interface to our function is

function AnsiStringReplace(const S, OldPattern, NewPattern: AnsiString;
Flags: TReplaceFlags): AnsiString;

while the RTL function is defined as

function StringReplace(const S, OldPattern, NewPattern: string; Flags:
TReplaceFlags): string;

Our function only supports AnsiStrings - not multi byte chars.

From John's unit

{Equivalent of StringReplace for Non Multi Byte Character Sets}

It would also be nice with a description of how to add our function to the
RTL. Perhaps as an overloaded function?

function StringReplace(const S, OldPattern, NewPattern: string; Flags:
TReplaceFlags): string; overload;

function StringReplace(const S, OldPattern, NewPattern: AnsiString; Flags:
TReplaceFlags): AnsiString; overload;

Best regards
Dennis Kjaer Christensen

----------------------------------------------------------------------------
----
Jeg beskyttes af den gratis SPAMfighter til privatbrugere.
Den har indtil videre sparet mig for at få 6187 spam-mails
Betalende brugere får ikke denne besked i deres e-mails.
Hent en gratis SPAMfighter her.


.



Relevant Pages

  • [SUMMARY] AnsiString (#185)
    ... It would seem that writing Transfire's desired `ANSIString` class is ... Robert relies on other libraries to provide the actual ANSI codes; ... def register_lib lib_path, &blk ... string objects in a couple of ways: ...
    (comp.lang.ruby)
  • Re: Ascii und Ansi tauschen - Codeproblem
    ... eine Syntax "CharToOem AnsiString, AnsiString" die als Parameter 2x die selbe Variable bemüht für logisch, progammtechnisch zunmindest, unsinnig finde]. ... Was immer 'CharToOem AnsiString' bis hierhin tut erscheint logisch: der Funktionalität CharToOem wird ein Quelltext übergeben. ... Public Function ASCIItoANSI(ByVal AsciiString As String) As String ...
    (microsoft.public.de.word.vba)
  • Re: Did Borland doing well in Q4? Listen to the Earning CC
    ... Changing an type does not necessarily affect the application code. ... Because a String is *very* different from any ordinal type. ... to "ANSIString" etc. ... Not long after Tiburon is released you might hope to get a Unicode ...
    (borland.public.delphi.non-technical)
  • Re: Fastcode Memory Read Rules
    ... The two rules are for different string types ... How far beyond the end of the ansistring can allways safely be read and is garuanteed to not violate the general rule? ... I can't image that the allocator would waste more then maybe 8 bytes? ... hmz i only allign on 8 bytes in my own paging allocator, so this could run into problems with fastcode? ...
    (borland.public.delphi.language.basm)
  • Re: Substitution in the C++ string class
    ... // Returns true if the string is altered, ... bool operator(string& str, const string& origPattern, const ... string& newPattern) ...
    (comp.sources.d)