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.

Text = [string]

Property

Product: 

Class: 

Remarks

This retrieves the string value associated with a uCalc String object. If no argument is passed then the entire string is returned. Use Str(n) when you just want the string representation of a match. Use Match(n) when you want uCalc String Object that you can manipulate further.

This assigns a new string to the uCalc String object.

The Text property syntax is optional. It's presence can be infered

if s is a uCalc.String, you can do s.Text = "abc"; result = s.Text can be written as s = "abc"; result = s.

Examples

To_uCalcString

ID: 154

				
					using uCalcSoftware;

var uc = new uCalc();
var t = uc.NewTransformer();
t.Text = "if (x > 3) y = x * 2; else if(x == 5) y = x - 1;";
t.FromTo("1", "100");
t.Transform();

var Pattern = "if ({cond})";
Console.WriteLine(new uCalc.String(t).After(Pattern).Text);
Console.WriteLine(new uCalc.String(t).After(Pattern).After(Pattern));

var s = new uCalc.String();
s = "This is a test";
Console.WriteLine(new uCalc.Transformer(s).Text);
				
			
y = x * 2; else if(x == 5) y = x - 100;
 y = x - 100;
This is a test
				
					#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   auto t = uc.NewTransformer();
   t.Text("if (x > 3) y = x * 2; else if(x == 5) y = x - 1;");
   t.FromTo("1", "100");
   t.Transform();

   auto Pattern = "if ({cond})";
   cout <<  uCalc::String(t).After(Pattern).Text() << endl;
   cout <<  uCalc::String(t).After(Pattern).After(Pattern) << endl;

   uCalc::String s;
   s = "This is a test";
   cout <<  uCalc::Transformer(s).Text() << endl;
}
				
			
y = x * 2; else if(x == 5) y = x - 100;
 y = x - 100;
This is a test
				
					Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      Dim t = uc.NewTransformer()
      t.Text = "if (x > 3) y = x * 2; else if(x == 5) y = x - 1;"
      t.FromTo("1", "100")
      t.Transform()
      
      Dim Pattern = "if ({cond})"
      Console.WriteLine(new uCalc.String(t).After(Pattern).Text)
      Console.WriteLine(new uCalc.String(t).After(Pattern).After(Pattern))
      
      Dim s As New uCalc.String()
      s = "This is a test"
      Console.WriteLine(new uCalc.Transformer(s).Text)
   End Sub
End Module
				
			
y = x * 2; else if(x == 5) y = x - 100;
 y = x - 100;
This is a test