How to get the full string from JsVar string? #4968
Replies: 1 comment
-
Posted at 2021-04-06 by @gfwilliams Hi! Well, if you just want to print the string/variable, there's a special 'format' character
Is that what you're after? Otherwise if you need to get every character for use in your own code then There is another option which is to use the macro JSV_GET_AS_CHAR_ARRAY which will try and get a pointer to the string, will allocate memory on the stack and give you a pointer, or will just fail. Ideally don't use that for your own code, but it's useful if you're trying to use some other code which was designed just to work on a flat memory area Posted at 2021-04-11 by tyronehell @gfwilliams nice,
Posted at 2021-04-12 by @gfwilliams
As I said above, you need Posted at 2021-04-12 by @fanoush
maybe it was not clear from previous explanations - the string is not truncated, it is simply not stored in single piece anywhere in memory so to make it as single piece for you it must be created anew - on stack (or elsewhere) taking extra memory. So using iterator is definitely better if you iterate over it anyway, otherwise with larger strings you may overflow the stack |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2021-04-02 by tyronehell
I want to get the full string
dsafsafsafdsafdsafdsafdsafdsfdsafsafsafdsfsafsafsafdsaf
from JsVar string as follow, but the functionjsvAsString()
seems to make the string truncated short, any good way to solve the problem? useJsvStringIterator
iterator through the JsVar?any simple way?
thax!
Beta Was this translation helpful? Give feedback.
All reactions