Optional part in the Transformer

ID: 789

				
					using uCalcSoftware;

var uc = new uCalc();
var t = uc.NewTransformer();
t.FromTo("a [{txt}] b", "a, {txt:{txt}, }b");
Console.WriteLine(t.Transform("a b"));
Console.WriteLine(t.Transform("a x b"));


				
			
a, b
a, x, b
				
					#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   auto t = uc.NewTransformer();
   t.FromTo("a [{txt}] b", "a, {txt:{txt}, }b");
   cout << t.Transform("a b") << endl;
   cout << t.Transform("a x b") << endl;


}
				
			
a, b
a, x, b
				
					Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      Dim t = uc.NewTransformer()
      t.FromTo("a [{txt}] b", "a, {txt:{txt}, }b")
      Console.WriteLine(t.Transform("a b"))
      Console.WriteLine(t.Transform("a x b"))
      
      
   End Sub
End Module
				
			
a, b
a, x, b