C# extension methods for all sorts of things
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
LICENSE
README.md
jastExtensions.sln

README.md

Build status License

Package Name Status
jastBytes.Extensions.String NuGet version
jastBytes.Extensions.DateTime NuGet version
jastBytes.Extensions.DirectoryInfo NuGet version
jastBytes.Extensions.Linq NuGet version

jastExtensions

A library of .NET C# extension methods for .NETFramework >=4.5 and .NETStandard >=2.0.

Examples

using jastBytes.Extensions.String

// String encryption and decryption with AES
const string text = "Hello World!";
const string secretKey = "secret-string-to-encrypt";

var encryptedString = text.Encrypt(secretKey);
var decryptedString = encryptedString.Decrypt(secretKey);
// String conversion
bool boolResult = "true".ToBool();
int intResult = "1337".ToInt();

var camelCase = "hello world".ToCamelCase(); // camelCase = "helloWorld"
// Linq foreach
var listOfExecuted = new List<int>();

Enumerable
    .Range(0, 10)
    .Skip(1)
    .Take(2)
    .ForEachInvoke(i => listOfExecuted.Add(i)); // enumerate and invoke

var enumerable = Enumerable
    .Range(0, 10)
    .Skip(1)
    .Take(2)
    .ForEach(i => Console.WriteLine(i)); // not enumerated yet, no console output

var list = enumerable.ToList(); // list contains { 1, 2 } and these two numbers are printed on console

// listOfExecuted = { 1, 2 }