Demonstrating in-place modification with uCalc.String.Replace

ID: 227

See: Replace
				
					using uCalcSoftware;

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

using namespace std;
using namespace uCalcSoftware;

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