ParaMonte MATLAB 3.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation. |
Go to the source code of this file.
Functions | |
function | index (in str, in pattern) |
Return the starting index of the first occurrence of the input scalar MATLAB string pattern in the input scalar MATLAB string str , otherwise, return 0 to indicate the lack of the pattern in the input str .More... | |
function index | ( | in | str, |
in | pattern | ||
) |
Return the starting index of the first occurrence of the input scalar MATLAB string pattern
in the input scalar MATLAB string str
, otherwise, return 0
to indicate the lack of the pattern
in the input str
.
This function partially replicates the functionality of the Fortran intrinsic function index()
.
This function uses the MATLAB intrinsic strfind()
to achieve the goal. However, unlike strfind()
it always returns a number such that the function can be directly used in string slicing.
[in] | str | : The input scalar MATLAB string to be searched for the presence of the input pattern. |
[in] | pattern | : The input scalar MATLAB string to be searched for within the input str . |
loc
: The output scalar MATLAB integer containing the location of the first occurrence of the input pattern
in the input str
or 0
if no such pattern exists.
Possible calling interfaces ⛓
Example usage ⛓
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.