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.
Product:
Class:
Creates a live, modifiable view of the substring located between two specified patterns.
A new uCalc.String object representing a live, modifiable view into the portion of the parent string between the specified patterns. Returns an empty string object if the patterns are not found.
The Between method finds the text located between two specified patterns and returns it as a new uCalc.String object. This is a fundamental tool for parsing structured data and is a core part of the fluent, chainable API, often used with methods like After and Before.
The most important feature of this method is that it does not return a simple, disconnected substring. Instead, it returns a live, modifiable view into the parent string. This means:
startPattern & stopPattern: These define the boundaries of the text to be extracted. The returned view contains only the content between these boundaries, not including the boundaries themselves.startNth & stopNth: These 1-based indices allow you to handle documents with repeated patterns. For example, Between("(", ")", 2) would find the text inside the second set of parentheses.If either pattern is not found, the method returns an empty uCalc.String object without raising an error.
In a standard language like C#, extracting text between two markers requires a manual, multi-step process involving IndexOf and Substring.
C# Manual Approach:
string text = "Config{value=123}";int startIndex = text.IndexOf("{") + 1;int endIndex = text.IndexOf("}");if (startIndex != 0 && endIndex != -1){ string value = text.Substring(startIndex, endIndex - startIndex); // 'value' is a new, disconnected string: "value=123"}This approach is imperative, character-based, and creates disconnected data. uCalc.String provides a more powerful, declarative, and integrated solution:
The uCalc Advantage:
This ability to create live, token-aware, chainable views is a key differentiator, enabling a more fluid and powerful style of text manipulation that is not possible with standard string libraries.ID: 1272
using uCalcSoftware;
var uc = new uCalc();
using (var s = new uCalc.String("Data (important) more data")) {
// Get the text between the opening and closing parenthesis
var content = s.Between("(", ")");
Console.WriteLine(content);
}
important using uCalcSoftware; var uc = new uCalc(); using (var s = new uCalc.String("Data (important) more data")) { // Get the text between the opening and closing parenthesis var content = s.Between("(", ")"); Console.WriteLine(content); }
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
{
uCalc::String s("Data (important) more data");
s.Owned(); // Causes s to be released when it goes out of scope
// Get the text between the opening and closing parenthesis
auto content = s.Between("(", ")");
cout << content << endl;
}
}
important #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; { uCalc::String s("Data (important) more data"); s.Owned(); // Causes s to be released when it goes out of scope // Get the text between the opening and closing parenthesis auto content = s.Between("(", ")"); cout << content << endl; } }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Using s As New uCalc.String("Data (important) more data")
'// Get the text between the opening and closing parenthesis
Dim content = s.Between("(", ")")
Console.WriteLine(content)
End Using
End Sub
End Module
important Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Using s As New uCalc.String("Data (important) more data") '// Get the text between the opening and closing parenthesis Dim content = s.Between("(", ")") Console.WriteLine(content) End Using End Sub End Module
ID: 1273
using uCalcSoftware;
var uc = new uCalc();
using (var s = new uCalc.String("User: admin; Role: user; Department: Sales;")) {
// Extract the text between 'Department: ' and the trailing semicolon
var department = s.Between("Department: ", ";");
Console.WriteLine($"Department is '{department}'");
}
Department is ' Sales' using uCalcSoftware; var uc = new uCalc(); using (var s = new uCalc.String("User: admin; Role: user; Department: Sales;")) { // Extract the text between 'Department: ' and the trailing semicolon var department = s.Between("Department: ", ";"); Console.WriteLine($"Department is '{department}'"); }
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
{
uCalc::String s("User: admin; Role: user; Department: Sales;");
s.Owned(); // Causes s to be released when it goes out of scope
// Extract the text between 'Department: ' and the trailing semicolon
auto department = s.Between("Department: ", ";");
cout << "Department is '" << department << "'" << endl;
}
}
Department is ' Sales' #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; { uCalc::String s("User: admin; Role: user; Department: Sales;"); s.Owned(); // Causes s to be released when it goes out of scope // Extract the text between 'Department: ' and the trailing semicolon auto department = s.Between("Department: ", ";"); cout << "Department is '" << department << "'" << endl; } }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Using s As New uCalc.String("User: admin; Role: user; Department: Sales;")
'// Extract the text between 'Department: ' and the trailing semicolon
Dim department = s.Between("Department: ", ";")
Console.WriteLine($"Department is '{department}'")
End Using
End Sub
End Module
Department is ' Sales' Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Using s As New uCalc.String("User: admin; Role: user; Department: Sales;") '// Extract the text between 'Department: ' and the trailing semicolon Dim department = s.Between("Department: ", ";") Console.WriteLine($"Department is '{department}'") End Using End Sub End Module