Arc.StringSanitizer
1.0.3
See the version list below for details.
dotnet add package Arc.StringSanitizer --version 1.0.3
NuGet\Install-Package Arc.StringSanitizer -Version 1.0.3
<PackageReference Include="Arc.StringSanitizer" Version="1.0.3" />
paket add Arc.StringSanitizer --version 1.0.3
#r "nuget: Arc.StringSanitizer, 1.0.3"
// Install Arc.StringSanitizer as a Cake Addin #addin nuget:?package=Arc.StringSanitizer&version=1.0.3 // Install Arc.StringSanitizer as a Cake Tool #tool nuget:?package=Arc.StringSanitizer&version=1.0.3
String sanitizer
This library is to sanitize and unsanitize string. It is created with .NET 5 and Visual Studo 2019.
Suppose you are working on a string and there are some special chars in it for that you can't work with that string. Then you need to replace those special chars to anything simple chars with which you can work with the string. Also when you are done then you may need to revert them to get back to the previous state of the string.
This library helps you to do that. You can create a config with details like which special chars need to be replaced with which simple chars and call the sanitize method. When your work with the string will complete then you can revert all the sanitization by calling the unsanitize method of this library.
Install the library in your project with below command:
dotnet add package Arc.StringSanitizer
To sanitize a string:
string unsanitizedString =
"sample test with special char. some more char";
List<SanitizerConfig> sanitizerConfigs = new()
{
new SanitizerConfig("special char", "[sc]"),
new SanitizerConfig(" ", "[html space]")
};
string sanitizedString = unsanitizedString.Sanitize(sanitizerConfigs);
Console.WriteLine(sanitizedString);
// Output: sample test with [sc]. some more [html space] char
To unsanitize a string:
string sanitizedString =
"sample test with [sc]. some more [html space] char";
List<SanitizerConfig> sanitizerConfigs = new()
{
new SanitizerConfig("special char", "[sc]"),
new SanitizerConfig(" ", "[html space]")
};
string unsanitizedString = sanitizedString.Unsanitize(sanitizerConfigs);
Console.WriteLine(unsanitizedString);
// Output: sample test with special char. some more char
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
-
net6.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.
Package health and dotnet 6 upgrade