[Vala] Convert from byte to character offset in string



Hello,

Is there a convenient way to convert from a byte index in a string to
its character offset and vice-versa?

I know string has pointer_to_offset(string pos), but that's for
pointers, I have the value of a byte index, i.e. an int/uint/long
value, not a pointer.

Thanks,
James



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