| Contents |
#include <codecogs/strings/html_word_wrap.h>
using namespace Strings;
| char* | html_word_wrap (char* str, int str_len, int length) Wraps long lines of html text by replacing spaces with a newline. | |
| String | cc_stringsHtml_word_wrap (String str, Integer str_len, Integer length) This function is available as a Microsoft Excel add-in. |
| char*html_word_wrap( | char* | str | |
| int | str_len | ||
| int | length | ) |
#include <codecogs/strings/html_word_wrap.h> int main() { const char str[]="<strong>CodeCogs is being updated.</strong> We are just installing a <em>new build</em> of this <font size=\"+3\">website</font>. If you have any problems, then please wait 2 minutes while the configuration files are updated. <span class=\"orange\">Please also take this opportunity to send us any comments about features you would like to see.</span>"; printf("%s\n", html_word_wrap(str, strlen(str), 50)); }Output:
<strong>CodeCogs is being updated.</strong> We are just installing a <em>new build</em> of this <font size="+3">website</font>. If you have any problems, then please wait 2 minutes while the configuration files are updated. <span class="orange">Please also take this opportunity to send us any comments about features you would like to see.</span>
| str | The character string that needs wrapping. This is also the string returned by this functions. |
| str_len | The length of the string provided. Use strlen(str) if you are unsure. |
| length | The maximum length (or width) of any one line. Lines longer than length are wrapped at an appropriate word boundary at a position less than length. |