Line-wrap a string

Break a string into multiple lines

You are now following this Submission

The function linewrap.m wraps a single string into multiple lines by breaking it at word boundaries. The user can specify the desired maximum number of characters per line.

Cite As

Steve Eddins (2026). Line-wrap a string (https://ch.mathworks.com/matlabcentral/fileexchange/9909-line-wrap-a-string), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.1

Updated license

1.0.0.0

Update keywords and description to make it easier to find this file via search.