ExpertCs.Utils 2.1.0

dotnet add package ExpertCs.Utils --version 2.1.0
                    
NuGet\Install-Package ExpertCs.Utils -Version 2.1.0
                    
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="ExpertCs.Utils" Version="2.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ExpertCs.Utils" Version="2.1.0" />
                    
Directory.Packages.props
<PackageReference Include="ExpertCs.Utils" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ExpertCs.Utils --version 2.1.0
                    
#r "nuget: ExpertCs.Utils, 2.1.0"
                    
#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.
#addin nuget:?package=ExpertCs.Utils&version=2.1.0
                    
Install ExpertCs.Utils as a Cake Addin
#tool nuget:?package=ExpertCs.Utils&version=2.1.0
                    
Install ExpertCs.Utils as a Cake Tool

ExpertCs.Utils

  • Helpful utilities and classes
  • The library will be extended
  • Use at your own risk

<a id="GetInterpolatedString"></a>

ExpertCs.Utils.StringExtensions.GetInterpolatedString - interpolates an input string using expressions calculated for a given object.

/// <summary>
/// Интерполирует входную строку используя выражения вычесленные для заданного объекта.
/// </summary>
/// <example>
/// var s = "p1={IntField,10:n2}, p2={StrProp}, p3={IntField}, p4={(DateProp.Year+5):n2}, p5={DateProp:g}, 10={7+3}, p7={GetType().Name}, p8={DArray[1]:p2}";
///
/// var c = new
/// {
///     DateProp = DateTime.Now,
///     IntField = 5,
///     StrProp = "-test text-",
///     DArray = new decimal[] { 2m, 4.3m, 7m }
/// };
/// 
/// var ret1 = ExpertCs.Utils.StringExtensions.GetInterpolatedString(c, s);
///
/// var ret2 = c.GetInterpolatedString(s, System.Globalization.CultureInfo.GetCultureInfo("en"));
/// </example>
/// <param name="contextObject">Объект.</param>
/// <param name="interpolatedExpression">Выражение для форматирования.</param>
/// <param name="formatProvider"></param>
/// <exception cref="ArgumentNullException"></exception>
/// <exception cref="FormatException"></exception>
/// <returns></returns>
public static string FormatWithExpressions(
    this object contextObject,
    string interpolatedExpression,
    IFormatProvider? formatProvider = null)

Полезный метод

Есть ещё много полезного

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows 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 ExpertCs.Utils:

Package Downloads
ExpertCs.EfCore

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.0 131 13 days ago
2.0.0 451 14 days ago
1.1.0 452 14 days ago
1.0.0 454 15 days ago