I can do this with something like this:
B4X:
Sub CStr(oVal As String) As String
Return oVal
End Sub
[\CODE]
This is fine if oVal has a string assigned to it, eg: oVal = "abc"
However, this won't work if oVal has nil assigned to it, so for example:
[CODE]
Dim o As Object
Log(CStr(o))
[\CODE]
This will give something like: |java.lang.Object@fc3ece5|
Which I take is perhaps a memory location.
What I would like is for it to return "" so an empty string.
Any suggestions how to do this?
RBS