StringExpressionEvaluator 1.0.3

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

String Expression Evaluator


This is an AOT ready string expression evaluation library, inferior to any other library but works for an AOT solution. It supports arithmetic and bitwise operations and comparisons adhering to C order of operations with null support.

  • Indexing only applies to TryEvaluate and not TryEvaluate F
  • There is no support for the ternary operator
  • There is no null support, while artefacts for it remain in source

There are planned updates, but with no estimation for when they will be carried out.

Install:

dotnet add package SER

Usage:

// int math

using SER = StringExpressionEvaluator;

var symTable = new Dictionary<string, SER.SerUnion<int?>>() {
    {"a",    new SER.SerUnion<int>(1)},
};

var symTable = SymbolTable.Take((sym, val) => (sym, SER.SERUnion(val))).ToDictionary();

if (!StringExpressionEvaluator.TryEvaluate(ref expr, out var result, symTable)) {
    Console.WriteLine("Test Failed");
    return;
}

Console.WriteLine($"Got Result {result}");
// floating math

using SER = StringExpressionEvaluator;

var symTable = new Dictionary<string, float?>() {
    {"a", 1f},
};
if (symTable == null) throw new ArgumentNullException(nameof(symTable));
var expr     = "!(!0)";

if (!StringExpressionEvaluator.TryEvaluateF(ref expr, out var result, symTable)) {
    Console.WriteLine("Test Failed");
    return;
}

Console.WriteLine($"Got Result {result}");
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.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
1.0.3 144 3/18/2026
1.0.1 129 3/18/2026 1.0.1 is deprecated because it has critical bugs.
1.0.0 117 3/3/2026

Initial Release