MutableStringLibrary 1.1.24
dotnet add package MutableStringLibrary --version 1.1.24
NuGet\Install-Package MutableStringLibrary -Version 1.1.24
<PackageReference Include="MutableStringLibrary" Version="1.1.24" />
<PackageVersion Include="MutableStringLibrary" Version="1.1.24" />
<PackageReference Include="MutableStringLibrary" />
paket add MutableStringLibrary --version 1.1.24
#r "nuget: MutableStringLibrary, 1.1.24"
#:package MutableStringLibrary@1.1.24
#addin nuget:?package=MutableStringLibrary&version=1.1.24
#tool nuget:?package=MutableStringLibrary&version=1.1.24
MutableStringLibrary
A simple wrapper around the .NET String class that allows for easy value comparison and modification, with or without case sensitivity.
NuGet: Install-Package MutableStringLibrary
For analyzing a string:
Haschecks for a substring in a string.
Iscompares the string value with the value of another string.IsLimitedToCharacterschecks if the characters of a string are limited to a given set of characters.
For modifying a string:
CutAtremoves a given section from the string and returns the removed part.CutBeginningAtreturns the characters until the given position and keeps the remainder.CutEntAtreturns the characters efter the given position and keeps the beginning.LimitToCharactersremoves any character that is not represented in a given set of characters.MiddleTrimchanges any whitespaces to a single space.Resetsets the value to the default value, depending on theDefaultsToNullflag.
Flags:
AutoTrimDefaultsToNullIgnoreCase
For modifying a string list:
CutAtremoves a given section from the string and returns the removed part.CutBeginningAtreturns the characters until the given position and keeps the remainder.CutEntAtreturns the characters efter the given position and keeps the beginning.
Examples: Functions for modifying a string
These functions modify the string object and returns the difference.
CutBeginningAt
The function CutBeginningAt removes the beginning of a string and returns the removed part as a mutable string with the same flags as the original.
Basic example:
var s1 = new MutableString("Paul Stanley");
var s2 = s1.CutBeginningAt(5);
Console.WriteLine(s2.Value); // Paul
Console.WriteLine(s1.Value); // Stanley
Advanced example:
class PositionFinder : IPositionFinder
{
public int Find(MutableString value) =>
5;
}
var s1 = new MutableString("Paul Stanley");
var s2 = s1.CutBeginningAt(new PositionFinder());
Console.WriteLine(s2.Value); // Paul
Console.WriteLine(s1.Value); // Stanley
CutEndAt
The function CutEndAt removes the end of a string and returns the removed part as a mutable string with the same flags as the original.
Basic example:
var s1 = new MutableString("Paul Stanley");
var s2 = s1.CutEndAt(5);
Console.WriteLine(s2.Value); // Stanley
Console.WriteLine(s1.Value); // Paul
Advanced example:
class PositionFinder : IPositionFinder
{
public int Find(MutableString value) =>
5;
}
var s1 = new MutableString("Paul Stanley");
var s2 = s1.CutEndAt(new PositionFinder());
Console.WriteLine(s2.Value); // Stanley
Console.WriteLine(s1.Value); // Paul
MiddleTrim
Replaces any whitespaces with a single space.
Example:
var x = new MutableString("abc 123");
Assert.True(s.MiddleTrim()); // Returns true if string is affected
Assert.True("abc 123");
| Product | Versions 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 was computed. 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. |
-
net8.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.
Moved to .NET 8.0 and updated dependencies.