Oakrey.Strings 3.0.0

dotnet add package Oakrey.Strings --version 3.0.0
                    
NuGet\Install-Package Oakrey.Strings -Version 3.0.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="Oakrey.Strings" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Oakrey.Strings" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Oakrey.Strings" />
                    
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 Oakrey.Strings --version 3.0.0
                    
#r "nuget: Oakrey.Strings, 3.0.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 Oakrey.Strings@3.0.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=Oakrey.Strings&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Oakrey.Strings&version=3.0.0
                    
Install as a Cake Tool

Oakrey.Strings

Utilities for string parsing, numeral-system conversion, binary/hex encoding, text/code naming helpers and small string guard exceptions.

Installation

dotnet add package Oakrey.Strings

Package Manager Console:

Install-Package Oakrey.Strings

Binary And Hex

byte[] bytes = "0b1010_0101".FromBinaryStringToByteArray();
string binary = bytes.ToBinaryString(" ");

byte[] hexBytes = "0xA5-FF".FromHexadecimalStringToByteArray();
string hex = hexBytes.ToHexadecimalString(" ");

For user input, prefer the non-throwing helpers:

if (input.TryFromHexadecimalStringToByteArray(out byte[] parsed))
{
    // use parsed bytes
}

Numeric Parsing

The package supports binary, decimal and hexadecimal parsing for common numeric types.

int value = IntParser.Parse("0xFF", NumericParserOption.Hexadecimal);
bool parsed = NumericParser.NumericTryParse<byte>("0b1010", NumericParserOption.Binary, [ByteParser.TryBin], out byte byteValue);

Multiple-numeral-system helpers parse lists with configurable separators and ignore empty parts between repeated separators.

int[] values = "1,, 2;;;0x03".ParseInts([',', ';']);

Text Helpers

string pascal = "hello world".FromTextToPascalCase();
string camel = "hello world".FromTextToCamelCase();
string snake = "Hello World".FromTextToSnakeCase();
string kebab = "Hello World".FromTextToKebabCase();
string slug = "Příliš žluťoučký kůň".FromTextToSlug();

FromTextToSlug removes diacritics and lower-cases words using invariant culture.

Code-to-text helpers convert common identifier shapes back to readable text:

string text = "HttpServerError".FromPascalAndCamelCaseToText();
string name = "hello-world".FromKebabCaseToText();

The older FromKebebCaseToText spelling remains available for compatibility.

StringBuilder And Guards

StringBuilder builder = new();
builder.AppendLines(["first", "second"]);

value.ThrowIfEmpty(nameof(value));
value.ThrowIfWhiteSpace(nameof(value));

Safety Notes

  • Binary and hexadecimal converters validate allowed characters before conversion and expose non-throwing variants.
  • Numeric try-parse helpers catch expected parse failures and return false instead of leaking conversion exceptions.
  • Text casing uses invariant culture where casing is part of formatting behavior.
  • StringBuilder extension methods validate null receivers and arguments explicitly.

Project Information

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net11.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Oakrey.Strings:

Package Downloads
Oakrey.Xml

Provides a framework for working with XML in .NET applications, including parsing extensions, validation, XSD support, serialization, and LINQ to XML enhancements. Simplifies XML data manipulation and validation

Oakrey.Applications.Reporting

A .NET 11 library for structured, lifecycle-driven reporting. Defines IReporter and IReportConsumer generics with a TStatus enum, supporting report/block/item lifecycle events, evidence attachment, key-value metadata, and file output via FileReporter. RunnableReporter fans out to multiple consumers simultaneously.

Oakrey.ASRockMotherboard

Managed wrapper for the ASRock IMB-1222 motherboard native SDK (AsrCore.dll, Windows only). Provides IAsrMotherboard for GPIO pin control (pins 71-77, 80; input/output/state), and hardware telemetry reads: CPU core and package temperature, DC-in voltage, core count, and board serial number.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 70 11/13/2026
2.3.1 184 9/18/2026
2.3.0 208 7/13/2026
2.1.1 222 5/21/2026
2.1.0 199 2/11/2026
2.0.0 470 11/13/2025
1.2.0 226 10/17/2025
1.1.1 260 9/26/2025
1.1.0 352 9/26/2025
1.0.0 619 4/17/2025