StaticExtensions 2.0.0

This package has a SemVer 2.0.0 package version: 2.0.0+34.
There is a newer version of this package available.
See the version list below for details.
dotnet add package StaticExtensions --version 2.0.0                
NuGet\Install-Package StaticExtensions -Version 2.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="StaticExtensions" Version="2.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add StaticExtensions --version 2.0.0                
#r "nuget: StaticExtensions, 2.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 StaticExtensions as a Cake Addin
#addin nuget:?package=StaticExtensions&version=2.0.0

// Install StaticExtensions as a Cake Tool
#tool nuget:?package=StaticExtensions&version=2.0.0                

StaticExtensions

  • Extensions for all

    public static string MMCommonsFolder() { return "C:\\ProgramData\\MMCommons"; }
    public static string AppExeFolder(){ return MMConLocation() + "\\"; }
    public static string MMConLocation()  -- wrapper around Application.CommonAppDataPath backing up and adding "MMCommons";
    
    #region object exts

    public static bool IsNull(this object obj)
    public static bool AsBool(this object obj)
    public static string AsString(this object obj)
    public static int AsInt(this object obj)
    public static long AsLong(this object obj)
    public static DateTime AsDateTime(this object obj)
    public static Double AsDouble(this object obj)
    public static Decimal AsDecimal(this object obj)
    public static string AsJson(this object obj)

    #region Parse strings
    
    public static int ParseCount(this string content, string delims)
    public static string ParseString(this string content, string delims, int take)
    public static string ParseFirst(this string content, string delims)
    public static string ParseLast(this string content, string delims)
    public static string ParseReverse(this string content, string delims, string concatString)

    public static string AddQuotes(this string content) 
    public static string AddQuote(this string content)
    public static string RemoveChar(this string content, char CToRemove) 

    public static decimal AsDecimal(this string obj)
    public static string LTrim(this string content, char c) 

    #region Date to string with popular time formats. 
    
    public static string AsStrDate(this DateTime x)
    public static string AsStrDateTime12H(this DateTime x)
    public static string AsStrDateTime24H(this DateTime x)
    public static string AsStrTime(this DateTime x)
    public static string AsStrDateHHMM(this DateTime x)
    public static string AsStrDay(this DateTime x)

    #region Double

    public static Int32 AsInt32(this double x)
    public static Int32 AsInt32T(this double x)
    public static string AsStr2P(this double x)
    public static string AsStr2P(this double x, Int32 toHowManyPlaces, char paddingChar = ' ')
    public static string AsStr4P(this double x)
    public static string AsStr4P(this double x, Int32 toHowManyPlaces, char paddingChar = ' ')
    public static string AsStr8P(this double x)
    public static string AsStr8P(this double x, Int32 toHowManyPlaces, char paddingChar = ' ')
    public static decimal AsDecimal(this double x)
    public static double AsPointsVertical(this double dIn)
    public static double AsPointsHorizontal(this double dIn)

    #region Decimal
    
    public static float AsFloat(this decimal x) 
    public static int AsInt(this decimal x)
    public static int AsIntT(this decimal x)
    public static string AsStr2P(this decimal x)
    public static string AsStr2P(this decimal x, Int32 toHowManyPlaces, char paddingChar = ' ')
    public static string AsStr4P(this decimal x)
    public static string AsStr4P(this decimal x, Int32 toHowManyPlaces, char paddingChar = ' ')
    public static string AsStr8P(this decimal x)
    public static string AsStr8P(this decimal x, Int32 toHowManyPlaces, char paddingChar = ' ')
    public static double AsDouble(this decimal x)

    #region cryptish masks 
    
    // variant uses ? as fillers instead of = for base64 in inifiles.
    public static string AsBase64Encoded(this string Text)
    public static string AsBase64Decoded(this string Text)
        
    public static string AsHexStr(this byte[] byteArray) 
    public static byte[] AsByteArray(this string hexString)
    public static string AsFiletoMD5(string filePath) 

     
    public static string AsWalkExcTreePath(this Exception e)   
    public static Exception WriteAppLog(this Exception e, string messageString)
    public static void WriteToAppLog(this string messageString)
    public static string WriteToTextFile(this string stringToWrite, string logFileName)
    public static string WriteToTextFileLine(this string stringToWrite, string logFileName)
    public static Exception WriteToLogException(this Exception e, string logFileNamePart)

   
    // GetColors by Matt Meents, creates const foreach ARGB and then sum out the colors...
    public static Color[] GetColors(Color fromColor, Color toColor, int howMany)

  
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on StaticExtensions:

Package Downloads
AppCrypto

Reusable Helpers and Cuncurrent Dictionaries and IniFile

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.3 305 12/24/2022
2.0.2 529 11/27/2022
2.0.1 392 11/20/2022
2.0.0 75 11/19/2022
1.0.3 360 11/13/2022
1.0.2 349 11/12/2022
1.0.0 424 11/11/2022