strpad
Version 1.1.0 (2.93 KB) by
wfH
Add leading or trailing characters to character vector or cell array of character vectors in a single line of code.
In newer version (R2016b), it is easy to add leading or trailing characters to strings in a single line of code.
Just call the built-in function 'pad'.
So, I created this function for users with older version.
This function follows the same behaviour as the builtin.
Futhermore, the padding character, "padChar", is no need to be exactly single character.
Cite As
wfH (2026). strpad (https://uk.mathworks.com/matlabcentral/fileexchange/71674-strpad), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2018a
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Characters and Strings in Help Center and MATLAB Answers
Tags
Acknowledgements
Inspired by: String Support API, STRPAD String Pad for Matlab
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
