This repository has been archived by the owner on Jun 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Simplify.Extensions
Alexanderius edited this page Aug 18, 2016
·
4 revisions
Provides system classes extensions.
Available at NuGet as binary package and source package
// Converts bytes array to astring.
public static string GetString(this byte[] bytes);
// 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);
// 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);
// Removes milliseconds from the DateTime
public static DateTime TrimMilliseconds(this DateTime dt);