B
bayxarea-usenet
I have a need to break up some text into seperate lines based on a max
line length - currently I am just breaking at that character limit -
but this is not acceptable since it will break words arbitraily.
I need to implement a wrapping technique. I would like to reference a C
utility or library that is already written to do this - to remain
modular. However if no one knows of one in existance - some help
devloping the code would be appreciated.
In my case here I don't want to insert new line - This is a simple case
where it is a description field on a drawing - and i want to break it
up into 3 lines at 22 max characters per line. So either a char array
where each element is each line - or simply line1, line2, line3 would
great for now - but a more re-usable solution might be to use the char
array.
I envision something like this: 'pseudo-code example'
(re-usable)
(@lines) = wrap_split($description,22)
or
(just my case here)
(line1,line2,line3) = wrap_split($description,22)
Thanks for any suggestions on either the snippet of code to do this or
a header file I can reference that has a function that will do this
already.
Thanks,
John
line length - currently I am just breaking at that character limit -
but this is not acceptable since it will break words arbitraily.
I need to implement a wrapping technique. I would like to reference a C
utility or library that is already written to do this - to remain
modular. However if no one knows of one in existance - some help
devloping the code would be appreciated.
In my case here I don't want to insert new line - This is a simple case
where it is a description field on a drawing - and i want to break it
up into 3 lines at 22 max characters per line. So either a char array
where each element is each line - or simply line1, line2, line3 would
great for now - but a more re-usable solution might be to use the char
array.
I envision something like this: 'pseudo-code example'
(re-usable)
(@lines) = wrap_split($description,22)
or
(just my case here)
(line1,line2,line3) = wrap_split($description,22)
Thanks for any suggestions on either the snippet of code to do this or
a header file I can reference that has a function that will do this
already.
Thanks,
John