A basic find-and-replace operation to change one word to another using a fluent, chainable syntax.
ID: 1195
using uCalcSoftware;
var uc = new uCalc();
using (var t = new uCalc.Transformer()) {
// Define the rule and execute the transform in a single, chained statement.
t.FromTo("Hello", "Greetings");
Console.WriteLine(t.Transform("Hello World!"));
}
Greetings World! using uCalcSoftware; var uc = new uCalc(); using (var t = new uCalc.Transformer()) { // Define the rule and execute the transform in a single, chained statement. t.FromTo("Hello", "Greetings"); Console.WriteLine(t.Transform("Hello World!")); }
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
{
uCalc::Transformer t;
t.Owned(); // Causes t to be released when it goes out of scope
// Define the rule and execute the transform in a single, chained statement.
t.FromTo("Hello", "Greetings");
cout << t.Transform("Hello World!") << endl;
}
}
Greetings World! #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; { uCalc::Transformer t; t.Owned(); // Causes t to be released when it goes out of scope // Define the rule and execute the transform in a single, chained statement. t.FromTo("Hello", "Greetings"); cout << t.Transform("Hello World!") << endl; } }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Using t As New uCalc.Transformer()
'// Define the rule and execute the transform in a single, chained statement.
t.FromTo("Hello", "Greetings")
Console.WriteLine(t.Transform("Hello World!"))
End Using
End Sub
End Module
Greetings World! Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Using t As New uCalc.Transformer() '// Define the rule and execute the transform in a single, chained statement. t.FromTo("Hello", "Greetings") Console.WriteLine(t.Transform("Hello World!")) End Using End Sub End Module