@robalstona said in UIFlow - Trimming Strings:
@notdodgy, show me example input string, and write what exactly you need "extract" from this json string. Show me what string you except as output according to example input string. It is a some kind of homework?. I don't know why you make so many character substitutions in the text.
in python code you could use this construction:
out_str = in_str.replace('[', '').replace(']', '').replace...
but i dont tested yet how long may be replace chain.
Hello. It's a simple problem but the work around is not.
This is a fairly large chunk of data which is json encoded.
It's provided from a server API which I cannot change.
It's from the servers that control my Car home charger.
I am creating a remote monitor as a simple visual display. I can also use it to do basic start/stop actions.
It contains a number of [ and ] and spaces in the body which I need to keep unchanged.
My simple problem is it has an additional "[" at the start and a "]" at the end.
This extra pair of [ and ] stop "loads json" from working.
I only need to lose the first and last characters of the received data, while keeping the rest unchanged.
In other programming languages it would be a substr(data,1,(strlen(data)-2)) or string[1:-1] .