DotNetBesties 1.2.2

dotnet add package DotNetBesties --version 1.2.2
                    
NuGet\Install-Package DotNetBesties -Version 1.2.2
                    
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="DotNetBesties" Version="1.2.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DotNetBesties" Version="1.2.2" />
                    
Directory.Packages.props
<PackageReference Include="DotNetBesties" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DotNetBesties --version 1.2.2
                    
#r "nuget: DotNetBesties, 1.2.2"
                    
#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.
#:package DotNetBesties@1.2.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DotNetBesties&version=1.2.2
                    
Install as a Cake Addin
#tool nuget:?package=DotNetBesties&version=1.2.2
                    
Install as a Cake Tool

✨ DotNetBesties

.NET C# License

A comprehensive collection of powerful helper classes and extension methods for .NET 9+ and .NET 10 applications. This library provides productivity-boosting utilities for common development tasks including string manipulation, validation, formatting, and more.

πŸš€ Features

πŸ“ String Extensions & Helpers

  • Null/Empty Checks: IsNullOrEmpty(), IsNullOrWhiteSpace(), HasValue()
  • Validation: IsNumeric(), IsAlphanumeric()
  • Case Conversion: ToPascalCase(), ToCamelCase(), ToKebabCase(), ToSnakeCase(), ToTitleCase()
  • Encoding: ToBase64(), FromBase64()
  • Manipulation: Truncate(), Reverse(), RemoveWhitespace(), CollapseWhitespace()
  • Comparison: EqualsIgnoreCase(), StartsWithIgnoreCase(), EndsWithIgnoreCase()
  • Substring Operations: Left(), Right(), Mid()
  • Replace: ReplaceFirst(), ReplaceLast()
  • Utilities: CountOccurrences(), Repeat(), EnsureStartsWith(), EnsureEndsWith()

πŸ”’ Numeric Extensions

  • Int Extensions: Formatting, parsing, range checking
  • Long Extensions: Large number operations
  • Float/Double Extensions: Precision handling
  • Decimal Extensions: Financial calculations

πŸ“… Date & Time Extensions

  • DateTime Extensions: Formatting, manipulation, comparisons
  • DateOnly Extensions: Date-specific operations (.NET 6+)
  • TimeOnly Extensions: Time-specific operations (.NET 6+)
  • DateTimeOffset Extensions: Timezone-aware operations
  • TimeSpan Extensions: Duration calculations

βœ… Validation Helpers

  • IBAN Validation: International bank account number validation with mod-97 algorithm
  • Credit Card Validation: Luhn algorithm implementation
  • ISBN Validation: Book number validation (ISBN-10 and ISBN-13)
  • VIN Validation: Vehicle identification number validation
  • Phone Number Validation: International phone number formats
  • Postal Code Validation: Country-specific postal code validation
  • Internet Validation: Email, URL, and IP address validation

🎨 Format Helpers

  • CollectionHelper: List and array formatting
  • ColorHelper: Color conversion and manipulation
  • GuidHelper: GUID generation and formatting
  • ObjectHelper: Object serialization and formatting

πŸ”’ Security & Cryptography

  • EncryptionHelper: Encryption and decryption utilities

πŸ“¦ Serialization

  • JsonHelper: JSON serialization/deserialization utilities

πŸ› οΈ Common Utilities

  • RegexHelper: Regular expression utilities
  • StreamHelper: Stream operations
  • CultureInfoHelper: Culture-specific operations

🎯 Other Extensions

  • EnumExtensions: Enum utilities and parsing
  • BoolExtensions: Boolean operations
  • CharExtensions: Character operations
  • ColorExtensions: System.Drawing.Color extensions
  • ObjectExtensions: Generic object operations
  • CollectionExtensions: IEnumerable and collection extensions

πŸ“¦ Installation

Using .NET CLI

dotnet add package DotNetBesties

Using Package Manager Console

Install-Package DotNetBesties

Using PackageReference

<PackageReference Include="DotNetBesties.Helpers" Version="1.0.0" />

🎯 Quick Start

String Extensions Example

using DotNetBesties.Helpers.Extensions;

// Null/Empty checks
string? name = null;
if (name.IsNullOrEmpty()) 
{
    name = "John Doe";
}

// Case conversion
string title = "hello world".ToTitleCase(); // "Hello World"
string variable = "HelloWorld".ToCamelCase(); // "helloWorld"
string url = "Hello World".ToKebabCase(); // "hello-world"

// String manipulation
string text = "This is a very long text".Truncate(10); // "This is..."
string encoded = "Hello".ToBase64(); // "SGVsbG8="
string decoded = encoded.FromBase64(); // "Hello"

// Comparison
bool matches = "Hello".EqualsIgnoreCase("hello"); // true

Validation Examples

using DotNetBesties.Helpers.Validation;

// IBAN validation
bool isValid = IbanValidationHelper.IsValidIban("DE89370400440532013000");
string formatted = IbanValidationHelper.FormatIban("DE89370400440532013000");
// Result: "DE89 3704 0044 0532 0130 00"

// Credit card validation
bool isValidCard = CreditCardValidationHelper.IsValidCreditCard("4532015112830366");

// ISBN validation
bool isValidIsbn = IsbnValidationHelper.IsValidIsbn("978-3-16-148410-0");

// Phone number validation
bool isValidPhone = PhoneNumberValidationHelper.IsValidPhoneNumber("+49 123 456789", "DE");

DateTime Extensions Example

using DotNetBesties.Helpers.Extensions;

DateTime now = DateTime.Now;

// Date operations
DateTime tomorrow = now.AddDays(1);
bool isWeekend = now.DayOfWeek == DayOfWeek.Saturday || now.DayOfWeek == DayOfWeek.Sunday;

// Formatting
string formatted = now.ToString("yyyy-MM-dd");

Collection Extensions Example

using DotNetBesties.Helpers.Extensions;

var numbers = new[] { 1, 2, 3, 4, 5 };

// Collection operations
bool hasItems = numbers.Any();
int sum = numbers.Sum();

πŸ“‚ Project Structure

DotNetBesties.Helpers/
β”œβ”€β”€ src/
β”‚   └── DotNetBesties.Helpers/
β”‚       β”œβ”€β”€ Common/              # Common utilities
β”‚       β”‚   β”œβ”€β”€ CultureInfoHelper.cs
β”‚       β”‚   β”œβ”€β”€ RegexHelper.cs
β”‚       β”‚   └── StreamHelper.cs
β”‚       β”œβ”€β”€ Cryptology/          # Encryption utilities
β”‚       β”‚   └── EncryptionHelper.cs
β”‚       β”œβ”€β”€ Extensions/          # Extension methods
β”‚       β”‚   β”œβ”€β”€ BoolExtensions.cs
β”‚       β”‚   β”œβ”€β”€ CharExtensions.cs
β”‚       β”‚   β”œβ”€β”€ CollectionExtensions.cs
β”‚       β”‚   β”œβ”€β”€ ColorExtensions.cs
β”‚       β”‚   β”œβ”€β”€ DateOnlyExtensions.cs
β”‚       β”‚   β”œβ”€β”€ DateTimeExtensions.cs
β”‚       β”‚   β”œβ”€β”€ DateTimeOffsetExtensions.cs
β”‚       β”‚   β”œβ”€β”€ DecimalExtensions.cs
β”‚       β”‚   β”œβ”€β”€ DoubleExtensions.cs
β”‚       β”‚   β”œβ”€β”€ EnumExtensions.cs
β”‚       β”‚   β”œβ”€β”€ FloatExtensions.cs
β”‚       β”‚   β”œβ”€β”€ GuidExtensions.cs
β”‚       β”‚   β”œβ”€β”€ IntExtensions.cs
β”‚       β”‚   β”œβ”€β”€ LongExtensions.cs
β”‚       β”‚   β”œβ”€β”€ ObjectExtensions.cs
β”‚       β”‚   β”œβ”€β”€ StringExtensions.cs
β”‚       β”‚   β”œβ”€β”€ TimeOnlyExtensions.cs
β”‚       β”‚   └── TimeSpanExtensions.cs
β”‚       β”œβ”€β”€ Format/              # Formatting helpers
β”‚       β”‚   β”œβ”€β”€ BoolHelper.cs
β”‚       β”‚   β”œβ”€β”€ CharHelper.cs
β”‚       β”‚   β”œβ”€β”€ CollectionHelper.cs
β”‚       β”‚   β”œβ”€β”€ ColorHelper.cs
β”‚       β”‚   β”œβ”€β”€ DateOnlyHelper.cs
β”‚       β”‚   β”œβ”€β”€ DateTimeHelper.cs
β”‚       β”‚   β”œβ”€β”€ DateTimeOffsetHelper.cs
β”‚       β”‚   β”œβ”€β”€ DecimalHelper.cs
β”‚       β”‚   β”œβ”€β”€ DoubleHelper.cs
β”‚       β”‚   β”œβ”€β”€ EnumHelper.cs
β”‚       β”‚   β”œβ”€β”€ FloatHelper.cs
β”‚       β”‚   β”œβ”€β”€ GuidHelper.cs
β”‚       β”‚   β”œβ”€β”€ IntHelper.cs
β”‚       β”‚   β”œβ”€β”€ LongHelper.cs
β”‚       β”‚   β”œβ”€β”€ ObjectHelper.cs
β”‚       β”‚   β”œβ”€β”€ StringHelper.cs
β”‚       β”‚   β”œβ”€β”€ TimeOnlyHelper.cs
β”‚       β”‚   └── TimeSpanHelper.cs
β”‚       β”œβ”€β”€ Serialization/       # Serialization utilities
β”‚       β”‚   └── JsonHelper.cs
β”‚       └── Validation/          # Validation helpers
β”‚           β”œβ”€β”€ CreditCardValidationHelper.cs
β”‚           β”œβ”€β”€ IbanValidationHelper.cs
β”‚           β”œβ”€β”€ InternetValidationHelper.cs
β”‚           β”œβ”€β”€ IsbnValidationHelper.cs
β”‚           β”œβ”€β”€ PhoneNumberValidationHelper.cs
β”‚           β”œβ”€β”€ PostalCodeValidationHelper.cs
β”‚           └── VinValidationHelper.cs
└── tests/
    └── DotNetBesties.Helpers.Tests/
        β”œβ”€β”€ Common/              # Common tests
        β”œβ”€β”€ Cryptology/          # Encryption tests
        β”œβ”€β”€ Extensions/          # Extension tests
        β”œβ”€β”€ Format/              # Format tests
        β”œβ”€β”€ Serialization/       # Serialization tests
        └── Validation/          # Validation tests

πŸ§ͺ Testing

The project includes comprehensive unit tests using TUnit, covering all helper methods and extension functions.

# Run all tests
dotnet test

# Run tests with coverage
dotnet test --collect:"XPlat Code Coverage"

βš™οΈ Requirements

  • .NET 9.0 or higher
  • C# 13.0 or higher

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Coding Standards

  • Follow C# coding conventions
  • Include XML documentation for public APIs
  • Write unit tests for new features
  • Some Integration tests are implemented, but not all. Please consider adding more integration tests for new features.
  • Ensure all tests pass before submitting PR

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Built with ❀️ by the Moprojo team
  • Inspired by community needs for productive .NET development
  • Special thanks to all contributors

πŸ’¬ Support

πŸ—ΊοΈ Roadmap

  • Add more validation helpers
  • Performance optimizations
  • Additional collection extensions
  • Async/await extensions
  • More cryptography utilities

πŸ“Š Stats

GitHub stars GitHub forks GitHub watchers


Made with ❀️ by Moprojo

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net9.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.2.2 139 2/11/2026

Multi-targeting support for .NET 9 and .NET 10.