1. Any chance of adding a String type similar to .NET using records/operator overloads etc ?

    It would be nice to be able to do something like:

    var myString: DString;

    myString + ‘ more text ‘ + 123 + ‘.’;
    myString.Format(“Something here {0} “,myString2);
    (Parse/ToString/TryParse/etc etc etc etc)

    Basically cloning .NET String class. (like you’ve done for DateTime)

    It would make it easier for C# guys to move to delphi, instead of switching to Pos(), etc etc..

    Just a thought..


  2. Any chance of releasing the code ? (in or out of DeHL ?)

    I’m sure someone 🙂 Would be happy to assist in finishing the “TString” code.

  3. Nice..

    Couple of suggestions….

    Format() *** BUT USING .NET style params instead of SysUtils/Delphi style ***

    {0:C} for currency
    {0:D} for Decimal
    {0:0000.00} would pad 43.1 as 0043.10
    {0:X} for Hex
    {0,-10:0.0} would pad 123.4567 as “123.5 ”


    JclStrings has an method called… DotNetFormat() not sure if its a true clone of Format in .NET. Again.. .NET guys can translate easier to Delphi if the Format matches the .NET style.

    Missing from .NET in the DeHL String.pas are:

    Equals(String), IsNullOrEmpty, IsNullOrWhiteSpace, ToCharArray, TrimEnd,
    TrimStart() – I see TrimLeft etc.. So maybe an alias for TrimStart/TrimLeft.

    Maybe add some common extension methods ??



    For old Basic style programmers..

    And maybe ToBase64, IsNumeric, IsDate, IsAlpha ?

    Delphi2011 will be getting RegEx from what I understand so the IsXYZ methods could be record helpers in a StringExt file ???

  4. Added most things in. Some .NET methods make no sense in Delphi, for example String.IsNullOrEmpty. Nil and Empty strings are same on Delphi. I’ve marked those as deprecated by default and those are only compilable by a switch (on by default).

    Format is a bit tougher! There are many things there that needs implementing. will leave it for some other time when I do have it.

    Note: DeHL is not a .NET porting helper. There are decisions that I make that might not be .NET friendly.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.