MarkDev.Utils.CSharpHelpers 1.0.1

Install-Package MarkDev.Utils.CSharpHelpers -Version 1.0.1
dotnet add package MarkDev.Utils.CSharpHelpers --version 1.0.1
<PackageReference Include="MarkDev.Utils.CSharpHelpers" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MarkDev.Utils.CSharpHelpers --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MarkDev.Utils.CSharpHelpers, 1.0.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install MarkDev.Utils.CSharpHelpers as a Cake Addin
#addin nuget:?package=MarkDev.Utils.CSharpHelpers&version=1.0.1

// Install MarkDev.Utils.CSharpHelpers as a Cake Tool
#tool nuget:?package=MarkDev.Utils.CSharpHelpers&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

C-Sharp Helpers

This package comprises of collections of C# helper methods that are used every day by c-sharp developers. You don't have to write these helper functions yourself. There are currenlty eleven helper methods - still growing.

Helpers

Helpers.Right(int length) - Get substring of specified number of characters on the right.

Usage

var longString = "abcdefghijklmnopqrstuvwxyz";

var lastFourXters = longString.Right(4);

Helpers.Left(int length) - Get substring of specified number of characters on the left.

Usage

var longString = "abcdefghijklmnopqrstuvwxyz";

var lastFourXters = longString.Left(4);

Helpers.ToBase64() - Convert a given value to base64 string.

Usage

var name = "MarkAdesina";

var base64 = name.ToBase64();

Helpers.FromBase64() - Convert baase64 string to normal string.

Usage

var name = "somebase64string";

var rawString = name.FromBase64();

Helpers.IsValidEmail() - Verifies that a string is in valid e-mail format.

Usage

var email = "name@somedomain.com";

var isValid = email.IsValidEmail();

Helpers.ToBool() - Converts string to its boolean equivalent.

Usage

var someVal = "true";

var isBool = someVal.ToBool();

Helpers.EmptyIfNull() - Returns an empty string if null or empty is passed.

Usage

var someVal = "";

var val = someVal.EmptyIfNull();

Helpers.EncryptToDES(string key) - Encrypt value with DES Algorithm.

Usage

var someVal = "Some plain text to be encrypted";
var key ="mysecretKey";

var encryptedVal = someVal.EncryptToDES(key);

Helpers.DecryptFromDES(string key) - decrypt value with DES Algorithm.

Usage

var someVal = "Some encrypted value";
var key ="mysecretKey";

var decryptedVal = someVal.DecryptFromDES(key);

  • .NETCoreApp 3.1

    • No dependencies.
  • .NETFramework 4.5

    • No dependencies.
  • .NETFramework 4.5.1

    • No dependencies.
  • .NETFramework 4.5.2

    • No dependencies.
  • .NETFramework 4.6

    • No dependencies.
  • .NETFramework 4.6.1

    • No dependencies.
  • .NETFramework 4.6.2

    • No dependencies.
  • .NETFramework 4.7

    • No dependencies.
  • .NETFramework 4.7.2

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.
  • net5.0

    • 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.1 108 6/16/2021
1.0.0 114 6/10/2021