Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to substring by bytes

807589Sep 7 2008 — edited Sep 7 2008
Hi,
I need to save strings in different langauges in the DB, up to 24 bytes.
How can i substring by bytes in java?
for example:
Èçðàèëü - is 14 bytes, but the string length is 7
hhhhhhh - is 7 bytes and the string length is 7.
i would like to cut it by bytes - up to 7 bytes.
if i use substring method, i get 14 bytes for the Russian letters!
how can i do it?
Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 5 2008
Added on Sep 7 2008
4 comments
5,480 views