JOTHA Well-Known Member Licensed User Longtime User May 11, 2023 #1 Hello community, I have some text like this ... B4X: "Text1","Text2";"Text3" and I want to remove this sign ---> " <-- by code. Is there a solution with replace or regex? I tried several times, but no result ... Any help would be great! THX
Hello community, I have some text like this ... B4X: "Text1","Text2";"Text3" and I want to remove this sign ---> " <-- by code. Is there a solution with replace or regex? I tried several times, but no result ... Any help would be great! THX
DonManfred Expert Licensed User Longtime User May 11, 2023 #2 It works as expected B4X: Dim t As String = $""Text1","Text2";"Text3""$ Dim t2 = t.Replace($"""$,"") Log($"Vorher: ${t} -> Nachher ${t2}"$) Vorher: "Text1","Text2";"Text3" -> Nachher Text1,Text2;Text3 Click to expand... Upvote 1
It works as expected B4X: Dim t As String = $""Text1","Text2";"Text3""$ Dim t2 = t.Replace($"""$,"") Log($"Vorher: ${t} -> Nachher ${t2}"$) Vorher: "Text1","Text2";"Text3" -> Nachher Text1,Text2;Text3 Click to expand...
JOTHA Well-Known Member Licensed User Longtime User May 11, 2023 #3 DonManfred said: It works as expected B4X: Dim t As String = $""Text1","Text2";"Text3""$ Dim t2 = t.Replace($"""$,"") Log($"Vorher: ${t} -> Nachher ${t2}"$) Click to expand... Thank you Don Manfred! I found another solution: The sign " is a char: Chr(0x22), so I can replace it by this code: B4X: Text_X = Text_X.Replace(""&Chr(0x22)&"", "") Both solutions work fine . Upvote 0
DonManfred said: It works as expected B4X: Dim t As String = $""Text1","Text2";"Text3""$ Dim t2 = t.Replace($"""$,"") Log($"Vorher: ${t} -> Nachher ${t2}"$) Click to expand... Thank you Don Manfred! I found another solution: The sign " is a char: Chr(0x22), so I can replace it by this code: B4X: Text_X = Text_X.Replace(""&Chr(0x22)&"", "") Both solutions work fine .
M Mahares Expert Licensed User Longtime User May 11, 2023 #4 JOTHA said: Text_X = Text_X.Replace(""&Chr(0x22)&"", "") Click to expand... If you are looking for safe choices, here is one more: B4X: Dim Text_X As String = $""Text1","Text2";"Text3""$ Text_X = Text_X.Replace($"${QUOTE}"$,"") Log(Text_X) 'displays: Text1,Text2;Text3 Upvote 0
JOTHA said: Text_X = Text_X.Replace(""&Chr(0x22)&"", "") Click to expand... If you are looking for safe choices, here is one more: B4X: Dim Text_X As String = $""Text1","Text2";"Text3""$ Text_X = Text_X.Replace($"${QUOTE}"$,"") Log(Text_X) 'displays: Text1,Text2;Text3
DonManfred Expert Licensed User Longtime User May 11, 2023 #5 B4X: Text_X = Text_X.Replace(Chr(0x22), "") ;-) Upvote 0