ExpertCs.Utils 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global ExpertCs.Utils --version 2.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local ExpertCs.Utils --version 2.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=ExpertCs.Utils&version=2.0.0
                    
nuke :add-package ExpertCs.Utils --version 2.0.0
                    

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.

This package has no dependencies.

Version Downloads Last updated
2.1.0 137 3/27/2025
2.0.0 456 3/26/2025
1.1.0 456 3/26/2025
1.0.0 458 3/25/2025