Forum Discussion

EnTerr's avatar
EnTerr
Roku Guru
11 years ago

Is there a way to convert roString -> String?

Disclaimer: question is harder that it looks at first - due to how strings have evolved in BrS. E.g. check if you understand why this is (i just grokked it today... barely):
BrightScript Debugger> a = ["12", "1" + "2"]
BrightScript Debugger> ? type(a[0]), type(a[0], 3)
roString String
BrightScript Debugger> ? type(a[1]), type(a[1], 3)
String roString


So my question is, if given a true roString (a mutable object; akin to Java StringBuffer), is there a way for me to get a true String (immutable, intrinsic value; comp. Java String) out of it? Per documentation roString.getString() as String will do that but it doesn't (apparently it's a no-op in BS3).

I have a reason/use-case to look for the roString->String conversion. But I will be perfectly fine if conversion does not exist - just want to check if i missed a function or something; no nudging for a fix.
No RepliesBe the first to reply