File Exchange

image thumbnail

strpad

version 1.1.0 (2.93 KB) by wen-feng Huang
Add leading or trailing characters to character vector or cell array of character vectors in a single line of code.

1 Download

Updated 19 Apr 2020

View Version History

View License

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

wen-feng Huang (2021). strpad (https://www.mathworks.com/matlabcentral/fileexchange/71674-strpad), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R2018a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired by: String Support API, STRPAD String Pad for Matlab

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!