The MAP.GET() returns my string as an object. Now I want to trim the string, but how to cast an object to string?
B4X:
'this is easy:
Dim word as String = MyPropery.Get("Name")
word = word.Trim
'but how to cast in one line?
'this will not work:
Dim oneLine as String = MyPropery.Get("Name").Trim
Dim anotherLine as String = String(MyPropery.Get("Name")).Trim
This cannot work: Dim oneLine as String = MyPropery.Get("Name").Trim
There is no relation between the value returned from Map.Get and the left side type.
You will need to use a variable or a sub like this:
B4X:
Sub GetProperty(Key As String) As String
Return MyProperty.Get(Key)
End Sub