Android Question Python script

Cenny

Active Member
Licensed User
Longtime User
Hi,

I have to translate a string reading \"name\" : \"Doe\",\ which is a part of a Json string

Is there anybody out there who can tell me how this python script sentence reads in B4A?


thanks
Cenny
 

sirjo66

Well-Known Member
Licensed User
Longtime User
I think that it is
B4X:
"name" : "Doe"
so, for example, you can use
B4X:
Dim MyVar As String = """name"" : ""Doe"""

if you read this line from somewhere, you can:
B4X:
Dim MyVar As String = MyLineFromJSon.Replace("\""", """")
 
Upvote 0

aeric

Expert
Licensed User
Longtime User

B4X:
Dim m as Map = CreateMap("name": "Doe")
Log(m.As(JSON).ToString)
 
Last edited:
Upvote 0

Cenny

Active Member
Licensed User
Longtime User

B4X:
Dim m as Map = CreateMap("name": "Doe")
Log(m.As(JSON).ToString)
Thanks
 
Upvote 0
Top