Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() '// Create a transformer and perform a transformation Dim t = uc.NewTransformer() t.Text = "if (x > 3) y = x * 2; else if(x == 5) y = x - 1;" t.FromTo("1", "100") t.Transform() '// --- Interoperability and Chaining --- Dim Pattern = "if ({cond})" '// 1. Create a uCalc.String from a Transformer. '// 2. Chain .After() to get a "live view" of the text after the pattern. Dim s As New uCalc.String(t) Dim after_first_if = s.After(Pattern) Console.WriteLine(after_first_if.Text) '// 3. Chain another .After() on the child string. Dim after_second_if = after_first_if.After(Pattern) Console.WriteLine(after_second_if.Text) '// --- String to Transformer Conversion --- '// 4. Create a uCalc.String and assign it text. Dim s2 As New uCalc.String() s2 = "This is a test" '// 5. Create a Transformer from the uCalc.String to use transformer-specific methods. Dim t2 As New uCalc.Transformer(s2) Console.WriteLine(t2.Text) End Sub End Module