>I have a string that should be split to array of lines according to the
> - 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 = "abc"
> Line = "12 "
> Line ="45678";
This example doesn't seem to match your description. What happened to
line, and why is line 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.