GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - DennisTurco/StringKit: Lightweight, zero-dependency .NET library of string extension methods for case conversion, normalization, PII masking, validation, and encoding.

BranchesTags
Open more actions menu

Latest commit

 

History

20 Commits
20 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
StringKit.Tests
StringKit.Tests
 
 
StringKit
StringKit
 
 
assets
assets
 
 
docs
docs
 
 
hooks
hooks
 
 
images
images
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
StringKit.slnx
StringKit.slnx
 
 
coverage-report.md
coverage-report.md
 
 
docfx.json
docfx.json
 
 
index.md
index.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
setup.ps1
setup.ps1
 
 
toc.yml
toc.yml
 
 

Repository files navigation

StringKit icon

StringKit

FULL DOCUMENTATION: https://dennisturco.github.io/StringKit/

A lightweight .NET library of extension methods for common string transformations and formatting.

Coverage Downloads NuGet License: MIT

Installation

dotnet add package StringKit

Features

  • Case conversion: ToSlug, ToSnakeCase, ToCamelCase, ToPascalCase, ToTitleCase, ToSentenceCase
  • Truncation: Truncate (by characters) and TruncateWords (by word count)
  • Normalization: NormalizeSpaces, RemoveDiacritics, RemoveSpecialChars, NormalizeNewLines, StripHtml, CollapseWhitespace, JoinLines
  • Privacy / PII masking: Redact, MaskEmail, MaskPhone
  • Search & comparison: ContainsAny, ContainsAll, StartsWithAny, EndsWithAny, EqualsIgnoreCase
  • Validation: IsEmail, IsUrl, IsNumeric, IsAlpha, IsAlphanumeric, IsNullOrWhiteSpace, HasMinLength, HasMaxLength
  • Encoding / decoding: ToBase64, FromBase64, UrlEncode, UrlDecode, HtmlEncode, HtmlDecode
  • Utilities: Repeat, Reverse
  • Zero external dependencies: pure .NET BCL
  • All methods are static and thread-safe

Usage

using StringKit;

// Case conversion & truncation
"hello world".ToSlug()                              // "hello-world"
"hello world".ToCamelCase()                         // "helloWorld"
"hello world".ToPascalCase()                        // "HelloWorld"
"hello world".ToSnakeCase()                         // "hello_world"
"hello world".ToTitleCase(new CultureInfo("en-US")) // "Hello World"
"Hello World".Truncate(6)                           // "Hello..."
"ab".Repeat(3)                                      // "ababab"
"hello".Reverse()                                   // "olleh"

// Normalization
"  ciao    mondo  ".NormalizeSpaces()      // "ciao mondo"
"café".RemoveDiacritics()                  // "cafe"
"Hello! @#$%".RemoveSpecialChars()         // "Hello"
"<p>Hello <b>World</b></p>".StripHtml()    // "Hello World"

// Privacy / PII masking
"[email protected]".MaskEmail()   // "m****@mail.it"
"3331234567".MaskPhone()      // "333*****67"

// Search & comparison
"Hello World".ContainsAny("World", "Foo")  // true
"Hello".EqualsIgnoreCase("hello")          // true

// Validation
"[email protected]".IsEmail()     // true
"12345".IsNumeric()           // true
"Hello".HasMinLength(3)       // true

// Encoding / decoding
"Hello".ToBase64()            // "SGVsbG8="
"hello world".UrlEncode()     // "hello+world"
"<b>Hi</b>".HtmlEncode()      // "&lt;b&gt;Hi&lt;/b&gt;"

Contributing

Contributions are welcome! Please open an issue or pull request on GitHub.

See CONTRIBUTING.md for guidelines.

License

License: MIT

About

Lightweight, zero-dependency .NET library of string extension methods for case conversion, normalization, PII masking, validation, and encoding.

dennisturco.github.io/StringKit/

Topics

base64csharpdotnetencodingextension-methodshtml-encodenormalizationnugetnuget-packageopen-sourcestringstring-extensionsstring-manipulationutilitiesvalidation

Resources

Readme
MIT license

Contributing

Contributing
Activity

Stars

2 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Sponsor this project

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.