MicroElements.Formatting.Sources 1.0.1

Prefix Reserved
dotnet add package MicroElements.Formatting.Sources --version 1.0.1                
NuGet\Install-Package MicroElements.Formatting.Sources -Version 1.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MicroElements.Formatting.Sources" Version="1.0.1">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MicroElements.Formatting.Sources --version 1.0.1                
#r "nuget: MicroElements.Formatting.Sources, 1.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MicroElements.Formatting.Sources as a Cake Addin
#addin nuget:?package=MicroElements.Formatting.Sources&version=1.0.1

// Install MicroElements.Formatting.Sources as a Cake Tool
#tool nuget:?package=MicroElements.Formatting.Sources&version=1.0.1                

MicroElements.Formatting.Sources

MicroElements source only package: Formatting.

Source only package does not forces binary reference on it. Just add package and use as code.

Description

FormatValue formats numbers with invariant culture, date types in ISO formats, for collections uses FormatAsTuple

FormatAsTuple formats collections using arguments:

  • separator: The value that uses to separate items. DefaultValue = ", "
  • nullPlaceholder: The value that renders if item is null. DefaultValue = "null"
  • startSymbol: Start symbol. DefaultValue = '('.
  • endSymbol: End symbol. DefaultValue = ')'.
  • formatValue: Func that formats object value to string representation. By default uses FormatValue.
  • maxItems: The max number of items that will be formatted. By default not limited.
  • maxTextLength: Max result text length. Used to limit result text size. DefaultValue=1024
  • trimmedPlaceholder: The value that replaces trimmed part of sequence. DefaultValue = "..."

Usage

new[] { 1, 2 }.FormatAsTuple().Should().Be("(1, 2)");
new[] { 1.1, 2.5 }.FormatAsTuple().Should().Be("(1.1, 2.5)");

new[] { new DateTime(2021, 06, 22), new DateTime(2021, 06, 22, 13, 52, 49, 123)}
   .FormatAsTuple().Should().Be("(2021-06-22, 2021-06-22T13:52:49)");

Enumerable.Range(1, 100)
   .FormatAsTuple(maxItems: 2)
   .Should().Be("(1, 2, ...)");

Enumerable.Repeat("abcde", 100)
   .FormatAsTuple(maxTextLength: 14)
   .Should().Be("(abcde, ab...)")
   .And.Subject.Length.Should().Be(14);
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on MicroElements.Formatting.Sources:

Package Downloads
MicroElements.Shared.Sources

MicroElements source packages metapackage.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 841 12/13/2021
1.0.0 638 11/1/2021