CsharpUtilsLib 1.0.3

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

// Install CsharpUtilsLib as a Cake Tool
#tool nuget:?package=CsharpUtilsLib&version=1.0.3

CsharpUtilsLib

Lib with methods to facilitate day-to-day development with C#.


  • Brazil

Format Brazilian documents and others things:

  • FormatPIS
  • FormatCPF
  • FormatCNPJ
  • FormatPhoneNumber

Validate Brazilian documents and ohers things:

  • IsValidEmail
  • ValidateEAN
  • IsCNPJ
  • IsCPF
  • IsValidPis
  • IsValidVoterIDCard (Título de Eleitor)

  • Collections

Operations with collections:

  • ConcatLists
  • GetRandomElement
  • BubbleSort
  • MostFrequent
  • DictionaryIsNullOrEmpty
  • ListIsNullOrEmpty
  • AddIfNotNull (ICollection, IDictionary)
  • AddOrChangeValue
  • KeyValueIsNull
  • AddRangeIfNotNullOrEmpty
  • TryGetValue (IDictionary, Arrays, IList, KeyValuePair)
  • ToNullList

  • Crypto

Encryption algorithms

  • AesCrypto
  • Base32

  • Date

Operations with date objects:

  • GetAllYearDates
  • GetLastDayOfWeek
  • GetFirstDayOfWeek
  • LastDayOfMonth
  • GetAge
  • IsWeekend
  • IsWeekday
  • IsBetweenDates
  • GetNextWeekday
  • GetWeekdayCount

  • Enums

Operations with enums:

  • GetEnumValuesAndNames
  • GetEnumValues
  • GetDisplayName
  • GetEnumName
  • GetEnumValue

  • External

Operatons with external tools:

  • GetCEP
  • GoogleTranslate (class)

  • FilesDirectories

Operations with files and/or directories:

  • DeleteFile
  • DeleteFolder
  • IsXML
  • IsJson
  • IsHTML
  • CreateDirectoryIfNotExists
  • CreateFileIfNotExists
  • CreateLocalFileIfNotExists
  • CreateLocalDirectoryIfNotExists
  • FileTypeIdentify (class)

  • HTTP

Operations with http requests:

  • HttpWrapper (class)

  • Numerics

Operation with numbers:

  • GetLongestSequence
  • RandomNumbers
  • IsInRange
  • GetMissingNumbers
  • IsNumeric
  • GetAverage
  • Factorial
  • IsEven
  • IsOdd
  • IsPrime
  • StandardDeviation

  • Texts

Operation with strings:

  • IsSequentialRepetition
  • RemoveAllWhitespace
  • MultiReplace
  • GetMostFrequentSeparator
  • CountOcurrences
  • RemoveDiacritics
  • MatchFirstOcurrency
  • MatchListOcurrencies
  • RemoveDuplicateWords
  • GetUniqueKey
  • RemoveDocumentMask
  • ToTitleCase
  • ConvertToDatetime
  • SpecificSplit
  • Count
  • OnlyNumbers
  • SafeSubstring
  • ToByteArray
  • ToByteArrayAscii
  • ToAscii
  • ToUTF8

  • Web

Operations involving captures on the internet:

  • HtmlString (class)
  • CurrentPage and PageMetaData (Pagination classes)
  • RandomUserAgent (class)
  • Pagination
  • ToFormPostData
  • ToJsonPostData
  • GetQueryStringValue
  • GetAllQueryStringValues
  • AddQueryString
  • IsValidUrl
  • GetHeader
  • CombineUrl
  • ClearHtml
Product Compatible and additional computed target framework versions.
.NET Framework net is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.29 136 4/16/2024
1.0.28 83 4/15/2024
1.0.27 104 4/13/2024
1.0.26 293 1/14/2024
1.0.25 148 12/23/2023
1.0.24 108 12/17/2023
1.0.23 110 12/17/2023
1.0.22 123 8/29/2023
1.0.21 131 6/18/2023
1.0.20 133 6/5/2023
1.0.19 134 6/3/2023
1.0.18 134 5/18/2023
1.0.17 130 5/17/2023
1.0.16 173 4/9/2023
1.0.15 170 4/8/2023
1.0.14 175 4/8/2023
1.0.13 182 3/30/2023
1.0.12.1 181 3/29/2023
1.0.12 180 3/29/2023
1.0.11 180 3/29/2023
1.0.10 190 3/29/2023
1.0.9 196 3/28/2023
1.0.8 217 3/5/2023
1.0.7 217 3/4/2023
1.0.6 213 3/1/2023
1.0.5.1 224 3/1/2023
1.0.5 222 2/28/2023
1.0.4.1 220 2/28/2023
1.0.4 220 2/28/2023
1.0.3 224 2/25/2023
1.0.2 221 2/25/2023
1.0.1 230 2/15/2023
1.0.0 291 2/13/2023

Added CNJ validation and more file operations.