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 Split up a string into pieces of the given/specified length ????

807580Sep 1 2009 — edited Sep 12 2009
Hi

I've a large string with more than 1000 characters. I need to split the strings based on the given length basically length as parameter.

For example,

if i give length as 50, i need to split the characters of 50 characters each with total 20 strings

if i give length as 225, i need to split the characters of 225 characters each with total 5 Strings (4 strings with 225 characters and balance 100
characters with 1 string)


Can anyone please tell me how to achieve in Java?

Thanks,
Kathir
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 10 2009
Added on Sep 1 2009
99 comments
1,096 views