>I have a string that should be split to array of lines according to the
>following:
> - newline donates end of the current line
> - each line should be not longer than 5 characters and line can
> split a word
>Assume that there is no words longer than 5 characters
>E.g. String "abc\n12 45678"
> Line[0] = "abc"
> Line[2] = "12 "
> Line[3] ="45678";
This example doesn't seem to match your description. What happened to
line[1], and why is line[2] only 3 characters long instead of 5 characters?
Could you describe better what you're trying to do?
BTW, why aren't you asking this question in a Perl newsgroup? The string
functions in Perl are hardly Unix-specific.
--
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.