[Vala] How to get a const substring without copying?



Hello,
It's me again.
In C language, sometimes we do this:
char* uri = "ftp://140.112.172.1";;
char* ip = str + 6;  // get the IP part of the string without copying.

With vala, either string.substring() or string[start:end] needs copying.
Is it possible to do the above in vala? In trivial cases this causes no
difference.
However, for more performance critical code, this can reduce many
unnecessary malloc/free.
Is this possible in Vala anyways?
I cannot find any clues in the tutorials and the docs.

Thanks


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]