Transformer Reset()
ID: 151
See: Reset
using uCalcSoftware;
var uc = new uCalc();
var t = uc.NewTransformer();
var txt = "a b c d e";
t.Text = txt;
t.FromTo("a", "aaa");
t.FromTo("c", "xyz");
Console.WriteLine($"Input: {t}");
Console.WriteLine($"Transformed: {t.Transform()}");
Console.WriteLine("Reset");
t.Reset();
Console.WriteLine($"Input: {t}(empty)");
t.Text = "a b c d e";
Console.WriteLine($"New input: {t.Text}");
Console.WriteLine($"Transformed: {t.Transform().Text} (no transform)");
Console.WriteLine("New rules");
t.FromTo("b", "ABC");
t.FromTo("d", "DDD");
Console.WriteLine($"Transformed: {t.Transform().Text}");
Input: a b c d e
Transformed: aaa b xyz d e
Reset
Input: (empty)
New input: a b c d e
Transformed: a b c d e (no transform)
New rules
Transformed: a ABC c DDD e using uCalcSoftware; var uc = new uCalc(); var t = uc.NewTransformer(); var txt = "a b c d e"; t.Text = txt; t.FromTo("a", "aaa"); t.FromTo("c", "xyz"); Console.WriteLine($"Input: {t}"); Console.WriteLine($"Transformed: {t.Transform()}"); Console.WriteLine("Reset"); t.Reset(); Console.WriteLine($"Input: {t}(empty)"); t.Text = "a b c d e"; Console.WriteLine($"New input: {t.Text}"); Console.WriteLine($"Transformed: {t.Transform().Text} (no transform)"); Console.WriteLine("New rules"); t.FromTo("b", "ABC"); t.FromTo("d", "DDD"); Console.WriteLine($"Transformed: {t.Transform().Text}");
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
auto t = uc.NewTransformer();
auto txt = "a b c d e";
t.Text(txt);
t.FromTo("a", "aaa");
t.FromTo("c", "xyz");
cout << "Input: " << t << endl;
cout << "Transformed: " << t.Transform() << endl;
cout << "Reset" << endl;
t.Reset();
cout << "Input: " << t << "(empty)" << endl;
t.Text("a b c d e");
cout << "New input: " << t.Text() << endl;
cout << "Transformed: " << t.Transform().Text() << " (no transform)" << endl;
cout << "New rules" << endl;
t.FromTo("b", "ABC");
t.FromTo("d", "DDD");
cout << "Transformed: " << t.Transform().Text() << endl;
}
Input: a b c d e
Transformed: aaa b xyz d e
Reset
Input: (empty)
New input: a b c d e
Transformed: a b c d e (no transform)
New rules
Transformed: a ABC c DDD e #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; auto t = uc.NewTransformer(); auto txt = "a b c d e"; t.Text(txt); t.FromTo("a", "aaa"); t.FromTo("c", "xyz"); cout << "Input: " << t << endl; cout << "Transformed: " << t.Transform() << endl; cout << "Reset" << endl; t.Reset(); cout << "Input: " << t << "(empty)" << endl; t.Text("a b c d e"); cout << "New input: " << t.Text() << endl; cout << "Transformed: " << t.Transform().Text() << " (no transform)" << endl; cout << "New rules" << endl; t.FromTo("b", "ABC"); t.FromTo("d", "DDD"); cout << "Transformed: " << t.Transform().Text() << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim t = uc.NewTransformer()
Dim txt = "a b c d e"
t.Text = txt
t.FromTo("a", "aaa")
t.FromTo("c", "xyz")
Console.WriteLine($"Input: {t}")
Console.WriteLine($"Transformed: {t.Transform()}")
Console.WriteLine("Reset")
t.Reset()
Console.WriteLine($"Input: {t}(empty)")
t.Text = "a b c d e"
Console.WriteLine($"New input: {t.Text}")
Console.WriteLine($"Transformed: {t.Transform().Text} (no transform)")
Console.WriteLine("New rules")
t.FromTo("b", "ABC")
t.FromTo("d", "DDD")
Console.WriteLine($"Transformed: {t.Transform().Text}")
End Sub
End Module
Input: a b c d e
Transformed: aaa b xyz d e
Reset
Input: (empty)
New input: a b c d e
Transformed: a b c d e (no transform)
New rules
Transformed: a ABC c DDD e Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim t = uc.NewTransformer() Dim txt = "a b c d e" t.Text = txt t.FromTo("a", "aaa") t.FromTo("c", "xyz") Console.WriteLine($"Input: {t}") Console.WriteLine($"Transformed: {t.Transform()}") Console.WriteLine("Reset") t.Reset() Console.WriteLine($"Input: {t}(empty)") t.Text = "a b c d e" Console.WriteLine($"New input: {t.Text}") Console.WriteLine($"Transformed: {t.Transform().Text} (no transform)") Console.WriteLine("New rules") t.FromTo("b", "ABC") t.FromTo("d", "DDD") Console.WriteLine($"Transformed: {t.Transform().Text}") End Sub End Module