Named optional part

ID: 195

				
					using uCalcSoftware;

var uc = new uCalc();
var t = uc.NewTransformer();

t.FromTo("a [{option: small | big }] test",
"a sample test{option: categorized as '{option}'}");

Console.WriteLine(t.Transform("This is a test."));
Console.WriteLine(t.Transform("This is a big test."));
Console.WriteLine(t.Transform("This is a small test."));
Console.WriteLine(t.Transform("This is a random test."));
				
			
This is a sample test.
This is a sample test categorized as 'big'.
This is a sample test categorized as 'small'.
This is a random test.
				
					#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   auto t = uc.NewTransformer();

   t.FromTo("a [{option: small | big }] test",
   "a sample test{option: categorized as '{option}'}");

   cout << t.Transform("This is a test.") << endl;
   cout << t.Transform("This is a big test.") << endl;
   cout << t.Transform("This is a small test.") << endl;
   cout << t.Transform("This is a random test.") << endl;
}
				
			
This is a sample test.
This is a sample test categorized as 'big'.
This is a sample test categorized as 'small'.
This is a random test.
				
					Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      Dim t = uc.NewTransformer()
      
      t.FromTo("a [{option: small | big }] test",
      "a sample test{option: categorized as '{option}'}")
      
      Console.WriteLine(t.Transform("This is a test."))
      Console.WriteLine(t.Transform("This is a big test."))
      Console.WriteLine(t.Transform("This is a small test."))
      Console.WriteLine(t.Transform("This is a random test."))
   End Sub
End Module
				
			
This is a sample test.
This is a sample test categorized as 'big'.
This is a sample test categorized as 'small'.
This is a random test.