Skip to content

Simplify.Extensions

Alexanderius edited this page Sep 15, 2019 · 1 revision

Provides system classes extensions.

Available at NuGet as binary package and source package

Bytes extensions

// Converts bytes array to astring.
public static string GetString(this byte[] bytes);

Double extensions

// Checking what two double values most likely the same ( the difference between values is less than Epsilon)
public static bool AreSameAs(this double a, double b);

String extensions

// Convert string to the bytes array.
public static byte[] ToBytesArray(this string str);

// Converts the specified string representation of a date and time to its DateTime? equivalent using the specified format, invariant culture format information. The format of the string representation must match at least one of the specified formats exactly. The method returns a value if the conversion succeeded otherwise null
public static DateTime? TryToDateTimeExact(this string s, string format);

DateTime extensions

// Removes milliseconds from the DateTime
public static DateTime TrimMilliseconds(this DateTime dt);
You can’t perform that action at this time.