![]() |
VOOZH | about |
dotnet add package Albatross.Text --version 9.0.3
NuGet\Install-Package Albatross.Text -Version 9.0.3
<PackageReference Include="Albatross.Text" Version="9.0.3" />
<PackageVersion Include="Albatross.Text" Version="9.0.3" />Directory.Packages.props
<PackageReference Include="Albatross.Text" />Project file
paket add Albatross.Text --version 9.0.3
#r "nuget: Albatross.Text, 9.0.3"
#:package Albatross.Text@9.0.3
#addin nuget:?package=Albatross.Text&version=9.0.3Install as a Cake Addin
#tool nuget:?package=Albatross.Text&version=9.0.3Install as a Cake Tool
A comprehensive .NET string manipulation library that provides powerful extension methods for working with strings, StringBuilder, and TextWriter classes.
Advanced string interpolation using ${expression} syntax that allows dynamic value replacement:
using Albatross.Text;
// Simple interpolation with dictionary
var template = "Hello ${name}, you have ${count} messages";
var values = new Dictionary<string, string>
{
["name"] = "John",
["count"] = "5"
};
var result = template.Interpolate(key => values[key]);
// Output: "Hello John, you have 5 messages"
Powerful string manipulation methods:
using Albatross.Text;
// Convert to proper case
"hello world".ProperCase(); // "Hello world"
// Convert to camel case
"HelloWorld".CamelCase(); // "helloWorld"
// Wildcard matching
"test.txt".Like("*.txt"); // true
// Trim custom strings from start/end
"prefixHelloSuffix".TrimStart("prefix"); // "HelloSuffix"
"prefixHelloSuffix".TrimEnd("Suffix"); // "prefixHello"
Enhanced StringBuilder functionality:
using Albatross.Text;
using System.Text;
var sb = new StringBuilder("Hello World");
bool endsWithWorld = sb.EndsWith("World"); // true
bool endsWithChar = sb.EndsWith('d'); // true
Fluent API for writing formatted text:
using Albatross.Text;
using System.IO;
var writer = new StringWriter();
writer.Append("Hello")
.Space()
.Append("World")
.Comma()
.Tab()
.AppendLine("Welcome!");
// Output: "Hello World, Welcome!\n"
// Specialized character methods
writer.OpenParenthesis()
.Append("content")
.CloseParenthesis()
.Dot();
// Output: "(content)."
Install-Package Albatross.Text
dotnet add package Albatross.Text
# Clone the repository
git clone https://github.com/RushuiGuan/text.git
cd text
# Restore dependencies
dotnet restore
# Build the project
dotnet build --configuration Release
# Run tests
dotnet test
using Albatross.Text;
using System.Collections.Generic;
var template = "User: ${username}, Email: ${email}";
var data = new Dictionary<string, string>
{
["username"] = "johndoe",
["email"] = "john@example.com"
};
var result = template.Interpolate(key => data.TryGetValue(key, out var value) ? value : "N/A");
Console.WriteLine(result); // "User: johndoe, Email: john@example.com"
using Albatross.Text;
// Chain multiple string operations
var processed = " HELLO WORLD "
.TrimStart(" ")
.TrimEnd(" ")
.CamelCase()
.PostfixIfNotNullOrEmpty('!');
Console.WriteLine(processed); // "helloWORLD!"
using Albatross.Text;
using System.IO;
var writer = new StringWriter();
var result = writer
.OpenSquareBracket()
.Append("Item1")
.Comma()
.Space()
.Append("Item2")
.CloseSquareBracket()
.ToString();
Console.WriteLine(result); // "[Item1, Item2]"
Albatross.Text/
├── StringInterpolationExtensions.cs # String interpolation functionality
├── StringExtensions.cs # General string manipulation methods
├── StringBuilderExtensions.cs # StringBuilder extension methods
├── TextWriterExtensions.cs # Fluent TextWriter API
└── README.md # Project documentation
The project includes comprehensive unit tests to ensure reliability:
# Run all tests
dotnet test
# Run tests with detailed output
dotnet test --verbosity normal
# Run tests for specific framework
dotnet test --framework net8.0
Test files are located in the Albatross.Text.Test project and cover:
We welcome contributions! Please follow these guidelines:
main:
git checkout -b feature/your-feature-name
dotnet test
git commit -m "Add: Brief description of your changes"
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) 2019 Rushui Guan
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on Albatross.Text:
| Package | Downloads |
|---|---|
|
Albatross.CodeGen
A customizable code generator engine with built in support for C# and TypeScript code generation |
|
|
Albatross.Text.Table
Convert collection of objects into a tabular string format with fluent interface.. Can print tabular data as a table or other formats using TextWriter. |
|
|
Albatross.Messaging
A durable messaging library built on top of ZeroMQ |
|
|
Albatross.EFCore.ChangeReporting
Package Description |
|
|
Albatross.Serialization.Binary
Provides additional functionalities for binary serialization over MessagePack |
This package is not used by any popular GitHub repositories.