wordwrap()
function wordwrap(string $string, int $width = 75, string $break = '\n', bool $cut_long_words = false): string
Wraps a string to a given number of characters.
Parameters:
$string(string)$width(int), default75, optional$break(string), default'\n', optional$cut_long_words(bool), defaultfalse, optional
Returns: string
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported — declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/string/wordwrap.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how wordwrap is implemented in the compiler, see the internals page.