There's no pure orx function for that, unfortunately, but I can add one. It'll rely on C support for string though, ie. almost none.
Basically it'll allocate a new buffer (you'll be responsible for deleting it) and copy the substring into it, with a 0 terminal character.
One of the very very old items on my todo list is to add support for dual marker strings, ie. string that are not defined by address + 0-termination but by two addresses: start and stop.
That has many advantages like cheap length computation, in-place substrings, etc... One day, maybe!
I needed to define such strings for the animation graph package on orxhub. Having utilities for them in orx would be great, especially when one is trying to stay away from STL, but what would be even greater is if certain basic orx functions had dual marker string versions. Like if orxString_GetID supported them, many tasks could be handled safely and efficiently with dual marker strings only.
Incredibly late reply, but why don't you use orxString_NPrint? Just give it size + 1 (for the '') and the entry + pos as the argument. It should work fine.
Comments
Basically it'll allocate a new buffer (you'll be responsible for deleting it) and copy the substring into it, with a 0 terminal character.
One of the very very old items on my todo list is to add support for dual marker strings, ie. string that are not defined by address + 0-termination but by two addresses: start and stop.
That has many advantages like cheap length computation, in-place substrings, etc... One day, maybe!
I solved it by converting to a std::string and doing a substr then converting back to orxSTRING.