tchart Well-Known Member Licensed User Longtime User Aug 31, 2017 #1 I need to put an example Smart String Literal within a Smart String Literal. It seems to interpret this as a variable. Example, my B4J code is this; B4X: resp.Write($"{"Result" : "${t}"}"$) I want to write this out as a string. I tried this but it doesnt work. B4X: Dim tt As String tt = $"resp.Write($"{"Result" : "${t}"}"$)"$ Is this possible?
I need to put an example Smart String Literal within a Smart String Literal. It seems to interpret this as a variable. Example, my B4J code is this; B4X: resp.Write($"{"Result" : "${t}"}"$) I want to write this out as a string. I tried this but it doesnt work. B4X: Dim tt As String tt = $"resp.Write($"{"Result" : "${t}"}"$)"$ Is this possible?
Cableguy Expert Licensed User Longtime User Aug 31, 2017 #2 Use Chr(XXX) where XXX is the $ ASCII value Upvote 0
R Roycefer Well-Known Member Licensed User Longtime User Aug 31, 2017 #3 B4X: Dim tt As String tt = "resp.Write(" & "$""{""Result"" : ""${t}""}""$)" or B4X: tt = "resp.Write($""{""Result"" : ""${t}""}""$)" Last edited: Aug 31, 2017 Upvote 0
B4X: Dim tt As String tt = "resp.Write(" & "$""{""Result"" : ""${t}""}""$)" or B4X: tt = "resp.Write($""{""Result"" : ""${t}""}""$)"
Erel B4X founder Staff member Licensed User Longtime User Aug 31, 2017 #4 Another option: B4X: Dim tt As String = $"resp.Write(~"{"Result" : "~{t}"}"~)"$.Replace("~", "$") Upvote 0
tchart Well-Known Member Licensed User Longtime User Aug 31, 2017 #5 Erel said: Another option: B4X: Dim tt As String = $"resp.Write(~"{"Result" : "~{t}"}"~)"$.Replace("~", "$") Click to expand... Oh thats clever @Erel, thanks! Upvote 0
Erel said: Another option: B4X: Dim tt As String = $"resp.Write(~"{"Result" : "~{t}"}"~)"$.Replace("~", "$") Click to expand... Oh thats clever @Erel, thanks!
tchart Well-Known Member Licensed User Longtime User Aug 31, 2017 #6 Thanks @Cableguy & @Roycefer Upvote 0