CaseON 3.0.0

dotnet add package CaseON --version 3.0.0
                    
NuGet\Install-Package CaseON -Version 3.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="CaseON" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CaseON" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="CaseON" />
                    
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 CaseON --version 3.0.0
                    
#r "nuget: CaseON, 3.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.
#:package CaseON@3.0.0
                    
#: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=CaseON&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=CaseON&version=3.0.0
                    
Install as a Cake Tool

CaseON

The all-in-one .NET string toolkit. Fast, dependency-free, AOT- and trim-friendly, and organized into small, discoverable modules you can call in one line.

using CaseON;

Text.ToSnakeCase("HelloWorld");      // "hello_world"
Validate.Email("user@example.com");  // true
Country.GetCallingCode(CountryCode.India); // 91
Slug.Generate("Héllo, World!");      // "hello-world"
Hash.Sha256("abc");                  // "ba7816bf8f01..."

Add one using CaseON; and every module is available as Module.Method(...) — no setup, no DI, no configuration.

Install

dotnet add package CaseON

Targets net8.0 and net9.0. Zero runtime dependencies.

Modules at a glance

Module What it does Examples
Text Case conversion, humanize, truncate ToSnakeCase, ToPascalCase, ToConstantCase, ToTrainCase, Humanize, ToIdentifier, Truncate, Convert
Validate Format validators (return bool) Email, Url, IPv4, Guid, CreditCard, Iban, Isbn, SemVer, Slug, PostalCode, PhoneNumber
Country ISO 3166-1 data GetCallingCode, GetInfo, GetName, TryParse, All
Similarity Edit distance & similarity Levenshtein, Damerau, Hamming, Jaro, JaroWinkler, Lcs, SorensenDice, Jaccard, Cosine, MyersDistance, Compute
Phonetic Sounds-like encoding Soundex, Metaphone, Nysiis, Cologne (+ *Equals)
Fuzzy Fuzzy matching Score, IsMatch, BestMatch, RankMatches, Search, IndexOf/ContainsApprox (Bitap)
Extract Pull fragments from text Emails, Urls, PhoneNumbers, Guids, IpAddresses, Hashtags, Mentions, Numbers, Domains
Normalize Canonicalize text Accents, Whitespace, LineEndings, Unicode, Nfc/Nfd/Nfkc/Nfkd, Punctuation, Digits
Clean Strip unwanted characters RemoveEmoji, RemoveHtml, RemovePunctuation, RemoveControlCharacters, RemoveNumbers, RemoveLetters, RemoveSpecialCharacters, RemoveZeroWidth, RemoveBidiControls
Confusables Homoglyph / spoof detection Skeleton, AreConfusable, IsConfusableWith, ContainsConfusable
Mask Redact sensitive values Email, Phone, CreditCard, Iban, Ssn, Password, Custom
Hash Digests as hex Md5, Sha1, Sha256, Sha512, Crc32, Fnv1a32, Fnv1a64, XxHash64
Encode / Decode Binary-to-text & escaping Base64, Base64Url, Base32, Base58, Base85, Hex, Url, Html, JavaScript
Generate Secure random strings String, Alpha, Numeric, AlphaNumeric, Hex, Base64, Token, Guid, Password
Compare Comparison helpers Equals, StartsWith, EndsWith, Contains, NaturalCompare, NaturalComparer, Collate, CollationComparer
Search Search & character tests ContainsWord, ContainsPhrase, IsMatch, ContainsAny, ContainsAll, ContainsOnly, IsLetters, IsDigits, IsSymbols, IndexOf/AllIndexesOf (Boyer-Moore/KMP/Rabin-Karp)
AhoCorasick Multi-pattern search automaton FindAll, ContainsAny
SuffixArray / SuffixAutomaton Substring index utilities Contains, Count, Occurrences, DistinctSubstringCount
Trie Immutable prefix tree / autocomplete Build, Contains, StartsWith, Complete
BloomFilter Approximate set membership Create, Add, MightContain
BkTree Fuzzy dictionary search Add, AddRange, Search
Tokenize Split text Words, Sentences, Lines, Paragraphs, Camel, Pascal, Snake, Kebab, WithPositions, Detokenize
Streaming Lazy TextReader processing Lines, Words, Paragraphs
Slug URL slugs Generate
Inflect English inflection Pluralize, Singularize, Word, Ordinalize
Template Named placeholders Format, Interpolate
Metrics Content & readability metrics WordCount, SentenceCount, UniqueWords, ReadingTime, CharacterFrequency, Entropy, FleschReadingEase, FleschKincaidGrade, GunningFog, Smog, Readability, SyllableCount
Analyze Aggregate stats TextTextStats
Password Strength & policy Strength, Entropy, EstimatedCrackTime, Validate, HasUppercase, HasDigit, HasSymbol
RegexTools Safe regex helpers Escape, Unescape, IsMatch, Replace, Matches, NamedGroups
Diff LCS & Myers diff Lines, Words, Compare, Myers, MyersChars
Unicode Unicode inspection Category, IsEmoji, CombiningMarkCount, IsRightToLeft, SurrogatePairCount, CodePointCount, Graphemes/GraphemeCount, ContainsZeroWidth, ContainsBidiControl
Utf8 UTF-8 byte inspection CodePointCount, GraphemeCount, Entropy, EnumerateRunes
Transliterate Text → ASCII ToAscii
Language Script & language detection Script, Detect
Profanity Detect & censor Contains, Find, Censor

Quick start

using CaseON;

// Casing
Text.ToKebabCase("MyVariableName");          // "my-variable-name"
Text.ToSnakeCase("HTTPServer", preserveAcronyms: true); // "http_server"
Text.Humanize("first_name");                 // "First Name"
Text.Truncate("The quick brown fox", 12);    // "The quick b…"

// Validation
Validate.Iban("GB82 WEST 1234 5698 7654 32"); // true
Validate.PostalCode("M5V 3L9", CountryCode.Canada); // true

// Similarity & fuzzy search
Similarity.JaroWinkler("MARTHA", "MARHTA");  // ~0.961
Fuzzy.BestMatch("aple", new[] { "apple", "grape" })!.Value.Value; // "apple"

// Encoding & hashing
Encode.Base58("hello");                       // "Cn8eVZg"
Hash.XxHash64("abc");                          // non-cryptographic 64-bit hash

// Inflection & slugs
Inflect.Pluralize("category");                // "categories"
Inflect.Ordinalize(21);                       // "21st"
Slug.Generate("Crème Brûlée");                // "creme-brulee"

Design notes

  • Dependency-free & AOT-friendly. The library has no runtime package dependencies and is marked IsAotCompatible/IsTrimmable. Linguistic features (transliteration, language detection, profanity) are implemented in-box rather than via reflection/data-file packages, so they work under trimming and Native AOT.
  • Safe by default. Validate.* and Extract.* return false/empty for null input instead of throwing. All regular expressions are source-generated, culture-invariant and guarded with a match timeout to prevent ReDoS.
  • Performance. Dynamic-programming algorithms use rolling rows and ArrayPool<T>; hot paths such as Similarity.LevenshteinDistance offer ReadOnlySpan<char> overloads.
  • Security note. Hash.Md5/Hash.Sha1 are provided for checksums and interoperability only — use Sha256/Sha512 for security. Validators perform structural checks, not authoritative verification. Generate.Token/Generate.Password use a cryptographically secure RNG.

Versioning

CaseON follows Semantic Versioning. See CHANGELOG.md.

Contributing

Contributions are welcome — see CONTRIBUTING.md. Security issues: see SECURITY.md.

License

Licensed under the MIT License.

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

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on CaseON:

Package Downloads
Flowsy.Db.Unity

Provides functionality to access SQL databases with a configurable set of conventions and options for naming and formatting objects like tables, columns, routines and parameters.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 269 6/29/2026
1.4.0 5,270,826 11/29/2024 1.4.0 is deprecated because it is no longer maintained.
1.3.1-beta 216 11/27/2024
1.3.0 1,346 11/27/2024
1.2.0 1,349 11/26/2024
1.1.0 1,388 11/21/2024 1.1.0 is deprecated because it is no longer maintained.

See CHANGELOG.md for release notes.