ParaMonte MATLAB 3.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
quote.m
Go to the documentation of this file.
1%> \brief
2%> Return the input scalar MATLAB string as doubly quoted string
3%> such that the first and last character of the output string are double-quotation
4%> marks while escaping any instances of **double quote** in the Fortran/MATLAB style,
5%> by duplicating every quotation mark within the string.<br>
6%>
7%> \param[in] str : The input scalar MATLAB string to be doubly quoted.<br>
8%>
9%> \return
10%> ``strQuoted`` : The output scalar MATLAB string containing
11%> the doubly-quoted escaped input string.<br>
12%>
13%> \interface{quote}
14%> \code{.m}
15%>
16%> strQuoted = pm.fortran.quote(str)
17%>
18%> \endcode
19%>
20%> \example{quote}
21%> \include{lineno} example/fortran/quote/main.m
22%> \output{quote}
23%> \include{lineno} example/fortran/quote/main.out.m
24%>
25%> \final{quote}
26%>
27%> \author
28%> \JoshuaOsborne, May 21 2024, 4:40 AM, University of Texas at Arlington<br>
29%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
30%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
31function strQuoted = quote(str)
32 strQuoted = """" + strrep(str, """", """""") + """";
33end
function quote(in str)
Return the input scalar MATLAB string as doubly quoted string such that the first and last character ...