language-ext v3.3.49 Release Notes

Release Date: 2020-01-12 // almost 3 years ago
  • Collections ToString

    All of the collection types now have a default ToString() implementation that presents like so for small list-like collections:

    "[1, 2, 3, 4, 5]"
    

    And for maps: (HashMap and Map):

    "[(A: 1), (B: 2), (C: 3), (D: 4), (E: 5)]"
    

    Larger collections will have CollectionFormat.MaxShortItems and then an ellipsis followed by the number of items remaining. Unless the collection is lazy, in which case only the ellipsis will be shown:

    "[1, 2, 3, 4, 5 ... 50 more]"
    

    0๏ธโƒฃ CollectionFormat.MaxShortItems can be set directly if the default of 50 items in a ToString() isn't good suitable for your application.

    In addition to this there's two extra methods per collection type:

    string ToFullString(string separator = ", ")
    

    ๐Ÿ— This will build a string from all of the items in the collection.

    string ToFullArrayString(string separator = ", ")
    

    ๐Ÿ— This will build a string from all of the items in the collection and wrap with brackets [].

    ๐Ÿ›  Fixes