This content has been marked as final. Show 3 replies
First you need to very clearly and precisely describe your problem. You haven't done that so far.
Something like this:
1. Each line must be no more than 70 characters long.
2. If the 70-character limit comes in the middle of a word, the line breaks before that word.
3. If a word is longer than 70 characters, the line will be be broken mid-word at multiples of 70 characters.
This is just an example, and it may or may not adequately cover your requirements. The point is that you must clearly and unambiguously cover every possible case, and there must be no internal contradictions.
Edited by: jverd on Apr 4, 2011 10:07 AM
i have a string having 150 character i want to devide that string in three line first lien may contain 70 character second line also caontain 70 char and third line may contain 10 characters. but at the last word of the line should not be devided. if the last word length is 5 of 6 than the first line may have 75 or 76 character id the last word length is higher than 5 or 6 than the last word should be at initial word of second line and the forst line may have some less characters and so on for second and third line.
suppose this is the some exaple of line is contains 77 characters
"this is a dummy line of strings and the characters in this line are important"
the 70 character complete in ""this is a dummy line of strings and the characters in this line are im"
but the last word is devided in two parts it should not be there. if length of the last char is 5 or 6 beyond 70 char then the word should be in the first line
so frirst line should be
"this is a dummy line of strings and the characters in this line are" and "important" word should come at second line.
user9950484 wrote:Is it always exactly 150 characters? Or is 150 just an example?
i have a string having 150 character
i want to devide that string in three lineWill you always be dividing your input strings into 3 lines? Or is it just that your rules work out to 3 lines for a 150-char input?
first lien may contain 70 characterIt "may"? Does that mean that is also might not contain 70? If it's not always 70, why not?
I'm not reading any more. This is still too vague.