uCalcSoftware 5.7.0-preview.2
dotnet add package uCalcSoftware --version 5.7.0-preview.2
NuGet\Install-Package uCalcSoftware -Version 5.7.0-preview.2
<PackageReference Include="uCalcSoftware" Version="5.7.0-preview.2" />
<PackageVersion Include="uCalcSoftware" Version="5.7.0-preview.2" />
<PackageReference Include="uCalcSoftware" />
paket add uCalcSoftware --version 5.7.0-preview.2
#r "nuget: uCalcSoftware, 5.7.0-preview.2"
#:package uCalcSoftware@5.7.0-preview.2
#addin nuget:?package=uCalcSoftware&version=5.7.0-preview.2&prerelease
#tool nuget:?package=uCalcSoftware&version=5.7.0-preview.2&prerelease
uCalc: The High-Performance Math Expression Evaluator and Token-Aware Text Transformation Engine
Homepage | Documentation | Online interactive examples | What's New | Release Notes | License
uCalc API Preview Release Notice: This preview documentation describes the intended behavior of the API. It is not fully accurate or complete. The current preview build contains incomplete features, unoptimized performance, and is subject to breaking changes. Use of the preview version in your production code is not recommended.
uCalc is a suite of three components: a Fast Math Parser, a token-aware text Transformer, and a String library. They are powered by the same underlying advanced parser engine and designed to seamlessly integrate for sophisticated operations. The uCalc SDK is backed by extensive online documentation with numerous interactive examples.
Use uCalc to build spreadsheet calculation engines, dynamic report generators, static analysis/code refactoring tools, linters, game scripting environments, custom domain-specific languages (DSLs), and to perform data extraction, complex string building, markup language conversion, and more.
- uCalc Fast Math Parser lets you evaluate math expressions defined at runtime. It comes with many functions and operators, and lets you define your own as well, either at runtime, or by attaching them to functions in your source code. You can call the simple Eval() to evaluate an expression right away, or parse the expression once and evaluate it many times in a loop at optimal speeds. uCalc is easy to use, yet very powerful.
- uCalc Transformer is a smart, token-aware engine for searching, replacing, and restructuring text. Use it to parse structured or unstructured text alike. Not limited to character units, it understands units of text like quoted strings, whitespace, nested brackets, user-defined comment structures, etc., and shines where regex falls short. It supports advanced rewrite rules, while also being designed for human readability to make it simple to use.
- uCalc String Library is a smart, mutable string manipulation library that offers you live views into strings for surgical in-place editing of different parts of the string, respecting structural boundaries (for instance it can distinguish between alphanumeric symbols, quoted text, etc., or user defined units of text), using the same underlying token-aware parser as the transformer. Methods can be chained together fluently for easy deployment.
Runtimes for Windows (x86, x64, and ARM64), Linux (x64 and ARM64), macOS (Intel osx-64 and osx-ARM64 Apple Silicon), are carefully packaged into the same NuGet library. This allows for immediate plug-and-play integration without the hassle of setting up platform-specific plumbing.
Quick Start
Fast Math Parser
using uCalcSoftware;
var uc = new uCalc();
// 1. Expression Parser: Evaluate a simple math or string expression
uc.DefineVariable("n = 10");
uc.DefineFunction("Area(length, width) = length * width");
Console.WriteLine(uc.Eval("5 * Area(n, 6) / 2")); // Output: 150
uc.DefineVariable("FirstName = 'John'");
Console.WriteLine(uc.EvalStr("UCase(FirstName) + ' Doe'")); // Output: JOHN Doe
// 2. Evaluate an expression faster in a loop
var myVar = uc.DefineVariable("x");
var expr = uc.Parse("x * 2");
for (var i = 1; i <= 5; i++) {
myVar.Value(i);
Console.WriteLine($"When x is {i}, result is: {expr.Evaluate()}");
}
// Output:
// When x is 1, result is: 2
// ...
// When x is 5, result is: 10
Transformer
using uCalcSoftware;
// Transformer: Perform a basic find-and-replace to reformat a person's name
var t = new uCalc.Transformer();
t.FromTo("First Name: {first} [Middle Name: {middle}] Last Name: {last}", "Name: {last}, {first} {middle}");
Console.WriteLine(t.Transform("First Name: John-Paul Last Name: Doe")); // Output: Doe, John-Paul
Console.WriteLine(t.Transform("First Name: John Middle Name: Peter Last Name: Doe")); // Output: Doe, John Peter
String Library
using uCalcSoftware;
// String Library: Using a fluent, chainable operation to modify a subsection of text in-place within a string
var log = new uCalc.String("INFO: File-handling task. ERROR: File not found.");
log.After("ERROR: ").Replace("File", "Resource");
Console.WriteLine(log); // Output: INFO: File-handling task. ERROR: Resource not found.
Practical example: Creating a JSON minifier that takes a formatted string and removes all non-essential whitespace
using uCalcSoftware;
var t = new uCalc.Transformer();
// 1. Define rules to remove whitespace and newlines.
// The engine's default QuoteSensitive=true ensures whitespace inside strings is protected.
t.FromTo("{@Whitespace}", "");
t.FromTo("{@Newline}", "");
// 2. Define the formatted input string.
var formattedJson = """
{
"id": 123,
"name": "Example, with spaces",
"tags": [
"A",
"B"
]
}
""";
// 3. Run the transformation and print the result.
Console.WriteLine(t.Transform(formattedJson));
// Output: {"id":123,"name":"Example, with spaces","tags":["A","B"]}
Links
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.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.
| Version | Downloads | Last Updated |
|---|---|---|
| 5.7.0-preview.2 | 47 | 8/7/2026 |
| 5.7.0-preview.1 | 59 | 7/30/2026 |
