Gobln.Extensions is a library containing useful extensions.
- .Net 4.0 and higher
- .Net Core 2.0 and higher
- .Net Core 3.0 and higher
Install Gobln.Extensions, trough Nuget or other means.
using Gobln.Extensions;
//examples
if ("Find the word or words in the string".ContainsAll(new[] { "word", "words" }))
{
//Word or words found
}
var isPrime = 5.IsPrime();
var isLeap = new DateTime(2016, 10, 20).IsLeapYear();
For more examples, check the test project
- DateTime:
- Elapsed
- FirstDayOfMonth
- LastDayOfMonth
- FirstDayOfWeek
- FromUnixTimestamp
- GetAge
- IsLeapDay
- IsLeapYear
- Next
- Previous
- RoundToNearestInterval
- ToUnixTimestamp
- Truncate
- Dictionary:
- AddRange
- IEnumerable
- ToList
- ToArray
- ToHashTable
- DirectoryInfo
- DirectorySize
- GetFileExtensions
- Rename
- Enumerable
- Median
- StdDev
- HasDuplicates
- GetDuplicates
- ToBatch
- ToBatchEvenly
- Pivot
- ToCollection
- RandomItem
- Randomize
- WhereIf
- AnyIf
- Enum
- GetDescriptionValue
- GetDisplayValue
- FileInfo
- IsReady
- NameWithoutExtension
- Rename
- UriBuilder
- AddPath
- Type
- GetAttribute
- HasAttribute
- GetCoreType
- IsNullableType
- StringBuilder
- AppendLine
- Replace
- NameValueCollection
- GetValue
- TryGetValue
- Number
- IsPrime
- IsPalindrome
- IsEven
- Reverse
- Length
- LengthAbs
- GetFirstNumber
- ToArray
- String
- Contains
- ContainsAll
- FirstUpperRestLower
- GetLeftFrom
- GetRightFrom
- IsNumeric
- IsPalindrome
- Repeat
- Reverse
- SplitCapitalizedWords
- ToColor
- Similarity
- TrimEnd
- TrimStart
- Split
- Xml
- ToXmlElement
- ToXmlDocument
- ToXElement
- ToXDocument
The project is on Nuget. Install via the NuGet Package Manager.
PM > Install-Package Gobln.Extensions
I'm going to provide an documentation file, but haven't started on one yet. As for the Readme file, if there are any inconsitencies or grammatical errors feel free to let me know by an pull request. This also counts for problems in de code.
- If something is broken and you know how to fix it, send a pull request.
- If you have no idea what is wrong, create an issue.
If you have something you'd like to improve do not hesitate to send a Pull Request