Oakrey.Strings 2.3.0

dotnet add package Oakrey.Strings --version 2.3.0
                    
NuGet\Install-Package Oakrey.Strings -Version 2.3.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="2.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Oakrey.Strings" Version="2.3.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 2.3.0
                    
#r "nuget: Oakrey.Strings, 2.3.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@2.3.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=2.3.0
                    
Install as a Cake Addin
#tool nuget:?package=Oakrey.Strings&version=2.3.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 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 (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 10 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
2.3.0 92 7/13/2026
2.1.1 189 5/21/2026
2.1.0 176 2/11/2026
2.0.0 442 11/13/2025
1.2.0 205 10/17/2025
1.1.1 228 9/26/2025
1.1.0 323 9/26/2025
1.0.0 596 4/17/2025