uCalc API Version: 5.7.0-preview.1 Released: 7/30/2026
Warning
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.
Description: A structural directive used to inject specific characters into a pattern or replacement using their ASCII or Unicode numeric code points.
The {#} directive allows for the explicit definition of characters by their numeric values. This is particularly useful for representing characters that are either impossible to type, non-printing (control characters), or potentially ambiguous when viewed as literal text.
{#code}: Injects a single character.{#code1#code2#code3...}: Concatenates multiple characters into a single unit.For example, {#65#66#67} is equivalent to the literal string ABC.
{#0}), Tabs ({#9}), or Line Feeds ({#10}).Matching the character 'A' (ASCII 65) explicitly and replacing it with a text label.
New(uCalc::Transformer, t)// Match 'A' via its code pointt.FromTo("{#65}", "CHAR_A")wl(t.Transform("A content"))[Expected Output]CHAR_A content
Identifying a data string that contains embedded null characters ({#0}) and stripping them out to create clean text.
New(uCalc::Transformer, t)// Match a Null character and remove it (replace with empty string)t.FromTo("{#0}", "")// Data often comes from C-style buffers with trailing or embedded nullsvar(string, raw_data) = "Part1" + "{#0}" + "Part2"wl(t.Transform(raw_data))[Expected Output]Part1Part2
Verifying that multiple code points can be concatenated within a single set of curly braces.
New(uCalc::Transformer, t)// 72=H, 69=E, 76=L, 79=Ot.FromTo("GREET", "{#72#69#76#76#79}")wl(t.Transform("GREET user"))[Expected Output]HELLO user
{#} ensures that the transformation logic is independent of the text editor's encoding settings. It provides a deterministic way to target characters that might otherwise look like garbled text in a source file.{#} for standard printable characters (like {#65} for A) makes the pattern harder to read. It should be reserved for special characters or specific low-level protocol requirements.{#13#10}) makes it very easy to define specific platform-based sequences like CRLF without relying on the internal _newline variable logic.{@Newline}) and Topic 801 ({@Whitespace}) for higher-level structural matchers.ID: 202
using uCalcSoftware;
var uc = new uCalc();
var t = uc.NewTransformer();
t.FromTo("{#97#98#99}", "{#120#121#122}");
// Same as t.FromTo("abc", "xyz")
Console.WriteLine(t.Transform("abc"));
xyz using uCalcSoftware; var uc = new uCalc(); var t = uc.NewTransformer(); t.FromTo("{#97#98#99}", "{#120#121#122}"); // Same as t.FromTo("abc", "xyz") Console.WriteLine(t.Transform("abc"));
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
auto t = uc.NewTransformer();
t.FromTo("{#97#98#99}", "{#120#121#122}");
// Same as t.FromTo("abc", "xyz")
cout << t.Transform("abc") << endl;
}
xyz #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; auto t = uc.NewTransformer(); t.FromTo("{#97#98#99}", "{#120#121#122}"); // Same as t.FromTo("abc", "xyz") cout << t.Transform("abc") << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim t = uc.NewTransformer()
t.FromTo("{#97#98#99}", "{#120#121#122}")
'// Same as t.FromTo("abc", "xyz")
Console.WriteLine(t.Transform("abc"))
End Sub
End Module
xyz Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim t = uc.NewTransformer() t.FromTo("{#97#98#99}", "{#120#121#122}") '// Same as t.FromTo("abc", "xyz") Console.WriteLine(t.Transform("abc")) End Sub End Module