Slashes Fix

Replace \ with /. Helpful to use sprintf, compose etc.

You are now following this Submission

Some functions (e.g. compose, sprintf, fprintf) use the backward slash ('\') as escape character; therefore, any format specifier containing a backward slash result into error (Warning: Escaped character '\%' is not valid.). This function simply change any backward to forward slash, coping with the issue.
e.g. sprintf(slashes_fix(formatSpec),txt)

Cite As

Valerio Rubino (2026). Slashes Fix (https://www.mathworks.com/matlabcentral/fileexchange/90471-slashes-fix), 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