Android Question [SOLVED] How to replace this char ---> " <---

JOTHA

Well-Known Member
Licensed User
Longtime User
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
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
 
Upvote 1

JOTHA

Well-Known Member
Licensed User
Longtime User
It works as expected

B4X:
    Dim t As String = $""Text1","Text2";"Text3""$
    Dim t2 = t.Replace($"""$,"")
    Log($"Vorher: ${t} -> Nachher ${t2}"$)
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
Top