uCalc API Version: 2.1.3-preview.2 Released: 6/17/2026

Warning

uCalc API Preview Release Notice:The documentation describes the intended behavior of the API. The current preview build contains incomplete features, unoptimized performance, and is subject to breaking changes.

Replace

Method

Product: 

String Library

Class: 

String

Replaces occurences of a pattern with something else

Syntax

Replace(string, string)

Parameters

From_
string
patter of occurence to match
To_
string
replacement of occurence

Return

String

uCalc String object

Remarks

Replaces occurrences of a pattern with something else.

Examples

Demonstrating in-place modification with uCalc.String.Replace
				
					using uCalcSoftware;

var uc = new uCalc();
uCalc.String text = "This is foo";
text.Replace("foo", "bar"); // 'text' is now modified
Console.WriteLine(text);
				
			
This is bar
				
					#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   uCalc::String text = "This is foo";
   text.Replace("foo", "bar"); // 'text' is now modified
   cout << text << endl;
}
				
			
This is bar
				
					Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      Dim text As uCalc.String = "This is foo"
      text.Replace("foo", "bar") '// 'text' is now modified
      Console.WriteLine(text)
   End Sub
End Module
				
			
This is bar