MarcusMedina.Fluent.Text.Core 2.1.0

Suggested Alternatives

MarcusMedina.Fluent.Text

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package MarcusMedina.Fluent.Text.Core --version 2.1.0
                    
NuGet\Install-Package MarcusMedina.Fluent.Text.Core -Version 2.1.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="MarcusMedina.Fluent.Text.Core" Version="2.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MarcusMedina.Fluent.Text.Core" Version="2.1.0" />
                    
Directory.Packages.props
<PackageReference Include="MarcusMedina.Fluent.Text.Core" />
                    
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 MarcusMedina.Fluent.Text.Core --version 2.1.0
                    
#r "nuget: MarcusMedina.Fluent.Text.Core, 2.1.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 MarcusMedina.Fluent.Text.Core@2.1.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=MarcusMedina.Fluent.Text.Core&version=2.1.0
                    
Install as a Cake Addin
#tool nuget:?package=MarcusMedina.Fluent.Text.Core&version=2.1.0
                    
Install as a Cake Tool

FluentBuilders.Text (C# / .NET 8.0)

Enterprise-grade fluent string extensions for C# with comprehensive testing and documentation.

NuGet .NET 8.0 Build Coverage License


๐ŸŽฏ Philosophy

Semantic Namespaces - Zero LINQ Pollution!

Each extension category has its own namespace. Import only what you need, keeping IntelliSense clean and focused.

Unlike LINQ which adds 200+ methods to every collection, FluentBuilders.Text lets you choose:

  • Need casing? Import MarcusMedina.Fluent.Text.Extensions.Casing
  • Need extraction? Import MarcusMedina.Fluent.Text.Extensions.Extraction
  • Need everything? Import multiple namespaces

Result: Clean IntelliSense, intentional API surface, better developer experience.


๐Ÿš€ Installation

dotnet add package MarcusMedina.Fluent.Text

๐Ÿ“– Quick Start

// Import only what you need
using MarcusMedina.Fluent.Text.Extensions.Casing;
using MarcusMedina.Fluent.Text.Extensions.Extraction;

"hello world".ToPascalCase();           // "HelloWorld"
"hello world".Left(5);                  // "hello"
"Email: user@test.com".ExtractEmails(); // ["user@test.com"]

// C# built-ins (no extensions needed):
string.IsNullOrEmpty(value);
string.IsNullOrWhiteSpace(value);

๐Ÿ† Quality Standards

This library follows enterprise-grade quality standards:

  • โœ… 95%+ Test Coverage - Comprehensive unit tests with xUnit + FluentAssertions
  • โœ… Zero Vulnerabilities - Continuous security scanning with Dependabot
  • โœ… Multi-Platform CI/CD - Tested on Ubuntu, Windows, and macOS
  • โœ… Complete XML Documentation - Every method documented with examples
  • โœ… Null-Safety First - ArgumentNullException.ThrowIfNull everywhere
  • โœ… Culture-Aware - CultureInfo.InvariantCulture for predictable results
  • โœ… TDD-Developed - Red-Green-Refactor for every feature
  • โœ… Performance Optimized - Benchmarked for production use

๐Ÿ“š Extension Categories

๐Ÿ”น Casing

Namespace: MarcusMedina.Fluent.Text.Extensions.Casing

"hello world".ToPascalCase()          // "HelloWorld"
"HelloWorld".ToCamelCase()            // "helloWorld"
"HelloWorld".ToKebabCase()            // "hello-world"
"HelloWorld".ToSnakeCase()            // "hello_world"
"hello world".ToScreamingSnakeCase()  // "HELLO_WORLD"
"hello world".ToTitleCase()           // "Hello World"
"hello world".ToProperCase()          // "Hello World" (alias for TitleCase)
"hello world".ToSentenceCase()        // "Hello world"
"john doe".ToNameCase()               // "John Doe"

Methods: ToPascalCase, ToCamelCase, ToKebabCase, ToSnakeCase, ToScreamingSnakeCase, ToTitleCase, ToProperCase, ToSentenceCase, ToNameCase (9 core methods + additional variants like ToLeetSpeak, ToAlternatingCase, ToRandomCase)


๐Ÿ”น Line Endings

Namespace: MarcusMedina.Fluent.Text.Extensions.LineEndings

"text\r\nfile".ToUnixLineEndings()     // "text\nfile"
"text\nfile".ToWindowsLineEndings()    // "text\r\nfile"

Methods: ToUnixLineEndings, ToWindowsLineEndings, ToMacLineEndings, NormalizeLineEndings


๐Ÿ”น Pattern Matching

Namespace: MarcusMedina.Fluent.Text.Extensions.Pattern

"test".IsLike("te%")                      // true (SQL LIKE)
"hello".In(["hello", "world"])            // true
"bob".Between("alice", "charlie")         // true

Methods: IsLike, ContainsText, StartsWithText, EndsWithText, In, Between


๐Ÿ”น Extraction

Namespace: MarcusMedina.Fluent.Text.Extensions.Extraction

// Basic extraction
"hello world".Left(5)           // "hello"
"hello world".Right(5)          // "world"
"hello world".Mid(6, 5)         // "world"

// Data extraction
"Contact: user@test.com, admin@test.org".ExtractEmails()
// ["user@test.com", "admin@test.org"]

"Visit https://example.com".ExtractUrls()
// ["https://example.com"]

"Love #coding and #dotnet!".ExtractHashtags()
// ["#coding", "#dotnet"]

"Thanks @john and @jane!".ExtractMentions()
// ["@john", "@jane"]

Methods: Left, Right, Mid, ExtractEmails, ExtractUrls, ExtractPhoneNumbers, ExtractDates, ExtractNumbers, ExtractHashtags, ExtractMentions, ExtractBetween, ExtractWordsContaining, ExtractWordsStartingWith, ExtractWordsEndingWith, ExtractWordsOfLength, ExtractAllWords, ExtractAllSentences


๐Ÿ”น Counting

Namespace: MarcusMedina.Fluent.Text.Extensions.Counting

"Hello world, how are you?".CountWords()      // 5
"Hello world".CountVowels()                   // 3
"Hello World".CountUppercase()                // 2
"hello world".CountOccurrences('l')           // 3

Methods: CountWords, CountSentences, CountVowels, CountConsonants, CountOccurrences (char & string), CountLines, CountDigits, CountLetters, CountUppercase, CountLowercase


๐Ÿ”น Manipulation

Namespace: MarcusMedina.Fluent.Text.Extensions.Manipulation

"hello".Reverse()                             // "olleh"
"hello world today".ShuffleWords()            // "today hello world" (random)
"Ha".Repeat(3)                                // "HaHaHa"
"1234567890".Mask(4, 4)                       // "1234****90"
"This is a very long sentence".Truncate(10)   // "This is..."
"This is a very long sentence".WrapTextAt(20, breakWords: true)
// Wraps text at 20 chars

Methods: Reverse, Shuffle, ShuffleWords, ShuffleSentences, Repeat, Truncate, Mask, RemoveWhitespace, CollapseWhitespace, InsertAt, WrapTextAt


๐Ÿ”น Data Formats & Encoding

Namespace: MarcusMedina.Fluent.Text.Extensions.DataFormat

// CSV operations
"hello, world".ToCsvField()                    // "\"hello, world\""
var data = new string[,] { { "Name" }, { "John" } };
data.ToCsv();                                  // "Name\nJohn"

// JSON operations
"{\"name\":\"John\"}".IsValidJson()            // true
var list = new List<List<string>> { new() { "Name" }, new() { "John" } };
list.ToJsonArray();                            // [["Name"],["John"]]

// Encoding operations
"hello world".ToBase64()                       // "aGVsbG8gd29ybGQ="
"hello world".ToUrlEncoded()                   // "hello+world"
"<script>".ToHtmlEncoded()                     // "&lt;script&gt;"
"hello".ToHex()                                // "68656C6C6F"
"<tag>".ToXmlContent()                         // "&lt;tag&gt;"

Methods:

  • CSV: ToCsvField, FromCsvField, SplitCsvLine, ToCsvLine, ToCsv (3 overloads), FromCsvToArray, FromCsvToList
  • JSON: ToJsonString, FromJsonString, IsValidJson, ToJsonArray (3 overloads), FromJsonToArray, FromJsonToList
  • XML: ToXmlContent, FromXmlContent
  • Base64: ToBase64, FromBase64, IsValidBase64
  • URL: ToUrlEncoded, FromUrlEncoded
  • HTML: ToHtmlEncoded, FromHtmlEncoded
  • Hex: ToHex, FromHex, IsValidHex

โœจ Why FluentBuilders.Text?

โœ… Zero Namespace Pollution - Semantic namespaces, import only what you need โœ… Enterprise Quality - 95%+ coverage, zero vulnerabilities, multi-platform CI/CD โœ… Complete Documentation - XML docs with examples for every method โœ… Null-Safe & Culture-Aware - Production-ready reliability โœ… Educational - Perfect for learning extension methods and TDD โœ… Modern .NET 8.0 - File-scoped namespaces, nullable reference types


๐Ÿงช Development

Build & Test

cd csharp

# Restore dependencies
dotnet restore

# Build with zero warnings
dotnet build /p:TreatWarningsAsErrors=true

# Run tests with coverage
dotnet test /p:CollectCoverage=true /p:Threshold=95

# Format code
dotnet format

Quality Checks

# Security scan
dotnet list package --vulnerable --include-transitive

# Verify code style
dotnet format --verify-no-changes

CI/CD

This project uses enterprise-grade GitHub Actions workflows:

  • Continuous Integration - Quality gates, security scanning, multi-platform testing
  • Automated Releases - Version tagging triggers NuGet publishing
  • Dependabot - Automated dependency updates with security focus

See .github/workflows/ for details.


๐Ÿค Contributing

See ../CONTRIBUTING.md for guidelines.


๐Ÿ“„ License

MIT ยฉ Marcus Ackre Medina - See ../LICENSE


๐Ÿšง Status

Experimental - API may change before stable release

Product Compatible and additional computed target framework versions.
.NET 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.

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