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 the doubly-quoted escaped input string.<br>
11%>
12%> \interface{quote}
13%> \code{.m}
14%>
15%> strQuoted = pm.str.quote(str)
16%>
17%> \endcode
18%>
19%> \example{quote}
20%> \include{lineno} example/str/quote/main.m
21%> \output{quote}
22%> \include{lineno} example/str/quote/main.out.m
23%>
24%> \final{quote}
25%>
26%> \author
27%> \JoshuaOsborne, May 21 2024, 4:40 AM, University of Texas at Arlington<br>
28%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
29%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
30function strQuoted = quote(str)
31 strQuoted = """" + strrep(str, """", """""") + """";
32end
function quote(in str)
Return the input scalar MATLAB string as doubly quoted string such that the first and last character ...