Converting quoted strings into XML-style elements by stripping the original quotes.
ID: 895
See: {@String}
using uCalcSoftware;
var uc = new uCalc();
var t = new uCalc.Transformer();
// Use {s(1)} to get just the text inside the quotes
t.FromTo("msg = {@String:s}", "{s(1)} ");
string input = """
msg = "Welcome to uCalc!"
""";
Console.WriteLine(t.Transform(input));
<message>Welcome to uCalc!</message> using uCalcSoftware; var uc = new uCalc(); var t = new uCalc.Transformer(); // Use {s(1)} to get just the text inside the quotes t.FromTo("msg = {@String:s}", "<message>{s(1)}</message>"); string input = """ msg = "Welcome to uCalc!" """; Console.WriteLine(t.Transform(input));
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
uCalc::Transformer t;
// Use {s(1)} to get just the text inside the quotes
t.FromTo("msg = {@String:s}", "{s(1)} ");
string input = R"(msg = "Welcome to uCalc!")";
cout << t.Transform(input) << endl;
}
<message>Welcome to uCalc!</message> #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; uCalc::Transformer t; // Use {s(1)} to get just the text inside the quotes t.FromTo("msg = {@String:s}", "<message>{s(1)}</message>"); string input = R"(msg = "Welcome to uCalc!")"; cout << t.Transform(input) << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim t As New uCalc.Transformer()
'// Use {s(1)} to get just the text inside the quotes
t.FromTo("msg = {@String:s}", "{s(1)} ")
Dim input As String = "msg = ""Welcome to uCalc!"""
Console.WriteLine(t.Transform(input))
End Sub
End Module
<message>Welcome to uCalc!</message> Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim t As New uCalc.Transformer() '// Use {s(1)} to get just the text inside the quotes t.FromTo("msg = {@String:s}", "<message>{s(1)}</message>") Dim input As String = "msg = ""Welcome to uCalc!""" Console.WriteLine(t.Transform(input)) End Sub End Module