ContosoPackage 1.0.0
dotnet add package ContosoPackage --version 1.0.0
NuGet\Install-Package ContosoPackage -Version 1.0.0
<PackageReference Include="ContosoPackage" Version="1.0.0" />
<PackageVersion Include="ContosoPackage" Version="1.0.0" />
<PackageReference Include="ContosoPackage" />
paket add ContosoPackage --version 1.0.0
#r "nuget: ContosoPackage, 1.0.0"
#:package ContosoPackage@1.0.0
#addin nuget:?package=ContosoPackage&version=1.0.0
#tool nuget:?package=ContosoPackage&version=1.0.0
ContosoPackage
A comprehensive utility library providing common helper functions and extensions for .NET applications.
Features
- String Extensions: Enhanced string manipulation and validation methods
- DateTime Helpers: Convenient date and time calculation utilities
- Collection Extensions: Powerful collection manipulation and querying methods
Installation
Install the package via NuGet Package Manager:
Install-Package ContosoPackage
Or via .NET CLI:
dotnet add package ContosoPackage
Usage
String Extensions
using ContosoPackage.Utilities;
string text = "hello world";
string titleCase = text.ToTitleCase(); // "Hello World"
string email = "user@example.com";
bool isValid = email.IsValidEmail(); // true
string longText = "This is a very long text that needs to be truncated";
string truncated = longText.Truncate(20); // "This is a very lo..."
DateTime Helpers
using ContosoPackage.Utilities;
DateTime today = DateTime.Today;
DateTime startOfWeek = DateTimeHelpers.GetStartOfWeek(today);
DateTime endOfWeek = DateTimeHelpers.GetEndOfWeek(today);
DateTime birthDate = new DateTime(1990, 5, 15);
int age = DateTimeHelpers.CalculateAge(birthDate);
bool isWeekend = DateTimeHelpers.IsWeekend(DateTime.Today);
Collection Extensions
using ContosoPackage.Utilities;
var numbers = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
var chunks = numbers.Chunk(3); // [[1,2,3], [4,5,6], [7,8,9], [10]]
var items = new List<string> { "apple", "banana", "cherry" };
bool isEmpty = items.IsNullOrEmpty(); // false
var randomItem = items.Random(); // Returns a random item from the list
API Reference
StringExtensions
ToTitleCase()- Converts string to title caseIsValidEmail()- Validates email formatTruncate(int maxLength)- Truncates string with ellipsis
DateTimeHelpers
GetStartOfWeek(DateTime date)- Gets Monday of the weekGetEndOfWeek(DateTime date)- Gets Sunday of the weekCalculateAge(DateTime birthDate, DateTime? asOfDate = null)- Calculates ageIsWeekend(DateTime date)- Checks if date is weekend
CollectionExtensions
Chunk<T>(int chunkSize)- Splits collection into chunksIsNullOrEmpty<T>()- Checks if collection is null or emptyRandom<T>()- Returns random element from collection
Requirements
- .NET 6.0 or later
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
We welcome contributions! Please feel free to submit a Pull Request.
Support
If you encounter any issues or have questions, please open an issue on GitHub.
Contoso Corporation - Building better software tools for developers worldwide.
| Product | Versions 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- No dependencies.
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.0 | 0 | 10/17/2025 |
Initial release with core utility functions.