utility/library/snippet to handle wrapping text on column specified

  • Thread starter bayxarea-usenet
  • Start date
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top