CsharpExtensions 1.0.0

dotnet add package CsharpExtensions --version 1.0.0
NuGet\Install-Package CsharpExtensions -Version 1.0.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="CsharpExtensions" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CsharpExtensions --version 1.0.0
#r "nuget: CsharpExtensions, 1.0.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.
// Install CsharpExtensions as a Cake Addin
#addin nuget:?package=CsharpExtensions&version=1.0.0

// Install CsharpExtensions as a Cake Tool
#tool nuget:?package=CsharpExtensions&version=1.0.0

CsharpExtensions

Library contains simple and usefull extensions to C#. <br/> Full documentation: CsharpExtensionsDoc

Table of contents

General info

Library contains extensions to C# like stringExtensions, enumExtensions etc.

Technologies

  • C#

Code Examples

String extensions

ToShort
var test = "13";
var result = test.ToShort() ?? 0;
ToInt
var test = "13";
var result = test.ToInt() ?? 0;
ToLong
var test = "13";
var result = test.ToLong() ?? 0;
ToDouble
var test = "13";
var result = test.ToDouble() ?? 0;
ToDateTime
var test = "2019-09-09";
var result = test.ToDateTime();  //possible null
RemoveWhiteSpaces
var test = "test 111  222";
var result = test.RemoveWhiteSpaces();  //result: tes_t111__222
TransformToEnglishLetters
var test = "ąębcdęę";
var result = test.TransformToEnglishLetters();  //result: bcd

Enum extensions

GetDescription
var test = new TestEnum();
var result = test.GetDescription();

//result: List<string> {"desc1", "desc2"}

public enum TestEnum
{
    [Description("desc1")]
    Test1 = 1,

    [Description("desc2")]
    Test2 = 2
}
GetDescription
var test = new TestEnum();
var result = test.GetDescription("Test1");

//result: desc1

public enum TestEnum
{
    [Description("desc1")]
    Test1 = 1,

    [Description("desc2")]
    Test2 = 2
}
Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 532 9/2/2019

Create first version CsharpExtensions.