
\begin{DoxyItemize}
\item \hyperlink{string_blanks}{B\-L\-A\-N\-K\-S Create a blank string}  
\item \hyperlink{string_cellstr}{C\-E\-L\-L\-S\-T\-R Convert character array to cell array of strings}  
\item \hyperlink{string_deblank}{D\-E\-B\-L\-A\-N\-K Remove trailing blanks from a string}  
\item \hyperlink{string_isalpha}{I\-S\-A\-L\-P\-H\-A Test for Alpha Characters in a String}  
\item \hyperlink{string_isdigit}{I\-S\-D\-I\-G\-I\-T Test for Digit Characters in a String}  
\item \hyperlink{string_isspace}{I\-S\-S\-P\-A\-C\-E Test for Space Characters in a String}  
\item \hyperlink{string_lower}{L\-O\-W\-E\-R Convert strings to lower case}  
\item \hyperlink{string_regexp}{R\-E\-G\-E\-X\-P Regular Expression Matching Function}  
\item \hyperlink{string_regexprep}{R\-E\-G\-E\-X\-P\-R\-E\-P Regular Expression Replacement Function}  
\item \hyperlink{string_strcmp}{S\-T\-R\-C\-M\-P String Compare Function}  
\item \hyperlink{string_strcmpi}{S\-T\-R\-C\-M\-P\-I String Compare Case Insensitive Function}  
\item \hyperlink{string_strfind}{S\-T\-R\-F\-I\-N\-D Find Substring in a String}  
\item \hyperlink{string_strncmp}{S\-T\-R\-N\-C\-M\-P String Compare Function To Length N }  
\item \hyperlink{string_strrep}{S\-T\-R\-R\-E\-P String Replace Function}  
\item \hyperlink{string_strstr}{S\-T\-R\-S\-T\-R String Search Function}  
\item \hyperlink{string_strtrim}{S\-T\-R\-T\-R\-I\-M Trim Spaces from a String}  
\item \hyperlink{string_upper}{U\-P\-P\-E\-R Convert strings to upper case}  
\end{DoxyItemize}\hypertarget{string_blanks}{}\section{B\-L\-A\-N\-K\-S Create a blank string}\label{string_blanks}
Section\-: \hyperlink{sec_string}{String Functions} \hypertarget{vtkwidgets_vtkxyplotwidget_Usage}{}\subsection{Usage}\label{vtkwidgets_vtkxyplotwidget_Usage}
\begin{DoxyVerb}    str = blanks(n)
\end{DoxyVerb}
 Create a string {\ttfamily str} containing {\ttfamily n} blank charaters. \hypertarget{variables_struct_Example}{}\subsection{Example}\label{variables_struct_Example}
A simple example\-:


\begin{DoxyVerbInclude}
--> sprintf(['x0123456789y\n','x',blanks(10),'y\n'])

ans = 
x0123456789y
x          y
\end{DoxyVerbInclude}
 \hypertarget{string_cellstr}{}\section{C\-E\-L\-L\-S\-T\-R Convert character array to cell array of strings}\label{string_cellstr}
Section\-: \hyperlink{sec_string}{String Functions} \hypertarget{vtkwidgets_vtkxyplotwidget_Usage}{}\subsection{Usage}\label{vtkwidgets_vtkxyplotwidget_Usage}
The {\ttfamily cellstr} converts a character array matrix into a a cell array of individual strings. Each string in the matrix is placed in a different cell, and extra spaces are removed. The syntax for the command is \begin{DoxyVerb}   y = cellstr(x)
\end{DoxyVerb}
 where {\ttfamily x} is an {\ttfamily N x M} array of characters as a string. \hypertarget{variables_struct_Example}{}\subsection{Example}\label{variables_struct_Example}
Here is an example of how to use {\ttfamily cellstr}


\begin{DoxyVerbInclude}
--> a = ['quick';'brown';'fox  ';'is   ']

a = 
quick
brown
fox  
is   
--> cellstr(a)

ans = 
 [quick] 
 [brown] 
 [fox] 
 [is] 
\end{DoxyVerbInclude}
 \hypertarget{string_deblank}{}\section{D\-E\-B\-L\-A\-N\-K Remove trailing blanks from a string}\label{string_deblank}
Section\-: \hyperlink{sec_string}{String Functions} \hypertarget{vtkwidgets_vtkxyplotwidget_Usage}{}\subsection{Usage}\label{vtkwidgets_vtkxyplotwidget_Usage}
The {\ttfamily deblank} function removes spaces at the end of a string when used with the syntax \begin{DoxyVerb}   y = deblank(x)
\end{DoxyVerb}
 where {\ttfamily x} is a string, in which case, all of the extra spaces in {\ttfamily x} are stripped from the end of the string. Alternately, you can call {\ttfamily deblank} with a cell array of strings \begin{DoxyVerb}   y = deblank(c)
\end{DoxyVerb}
 in which case each string in the cell array is deblanked. \hypertarget{variables_struct_Example}{}\subsection{Example}\label{variables_struct_Example}
A simple example


\begin{DoxyVerbInclude}
--> deblank('hello   ')

ans = 
hello
\end{DoxyVerbInclude}


and a more complex example with a cell array of strings


\begin{DoxyVerbInclude}
--> deblank({'hello  ','there ','  is  ','  sign  '})

ans = 
 [hello] [there] [  is] [  sign] 
\end{DoxyVerbInclude}
 \hypertarget{string_isalpha}{}\section{I\-S\-A\-L\-P\-H\-A Test for Alpha Characters in a String}\label{string_isalpha}
Section\-: \hyperlink{sec_string}{String Functions} \hypertarget{vtkwidgets_vtkxyplotwidget_Usage}{}\subsection{Usage}\label{vtkwidgets_vtkxyplotwidget_Usage}
The {\ttfamily isalpha} functions returns a logical array that is 1 for characters in the argument string that are letters, and is a logical 0 for characters in the argument that are not letters. The syntax for its use is \begin{DoxyVerb}   x = isalpha(s)
\end{DoxyVerb}
 where {\ttfamily s} is a {\ttfamily string}. Note that this function is not locale sensitive, and returns a logical 1 for letters in the classic A\-S\-C\-I\-I sense (a through z, and A through Z). \hypertarget{variables_struct_Example}{}\subsection{Example}\label{variables_struct_Example}
A simple example of {\ttfamily isalpha}\-:


\begin{DoxyVerbInclude}
--> isalpha('numb3r5')

ans = 
 1 1 1 1 0 1 0 
\end{DoxyVerbInclude}
 \hypertarget{string_isdigit}{}\section{I\-S\-D\-I\-G\-I\-T Test for Digit Characters in a String}\label{string_isdigit}
Section\-: \hyperlink{sec_string}{String Functions} \hypertarget{vtkwidgets_vtkxyplotwidget_Usage}{}\subsection{Usage}\label{vtkwidgets_vtkxyplotwidget_Usage}
The {\ttfamily isdigit} functions returns a logical array that is 1 for characters in the argument string that are digits, and is a logical 0 for characters in the argument that are not digits. The syntax for its use is \begin{DoxyVerb}   x = isdigit(s)
\end{DoxyVerb}
 where {\ttfamily s} is a {\ttfamily string}. \hypertarget{variables_struct_Example}{}\subsection{Example}\label{variables_struct_Example}
A simple example of {\ttfamily isdigit}\-:


\begin{DoxyVerbInclude}
--> isdigit('numb3r5')

ans = 
 0 0 0 0 1 0 1 
\end{DoxyVerbInclude}
 \hypertarget{string_isspace}{}\section{I\-S\-S\-P\-A\-C\-E Test for Space Characters in a String}\label{string_isspace}
Section\-: \hyperlink{sec_string}{String Functions} \hypertarget{vtkwidgets_vtkxyplotwidget_Usage}{}\subsection{Usage}\label{vtkwidgets_vtkxyplotwidget_Usage}
The {\ttfamily isspace} functions returns a logical array that is 1 for characters in the argument string that are spaces, and is a logical 0 for characters in the argument that are not spaces. The syntax for its use is \begin{DoxyVerb}   x = isspace(s)
\end{DoxyVerb}
 where {\ttfamily s} is a {\ttfamily string}. A blank character is considered a space, newline, tab, carriage return, formfeed, and vertical tab. \hypertarget{variables_struct_Example}{}\subsection{Example}\label{variables_struct_Example}
A simple example of {\ttfamily isspace}\-:


\begin{DoxyVerbInclude}
--> isspace('  hello there world ')

ans = 
 1 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 
\end{DoxyVerbInclude}
 \hypertarget{string_lower}{}\section{L\-O\-W\-E\-R Convert strings to lower case}\label{string_lower}
Section\-: \hyperlink{sec_string}{String Functions} \hypertarget{vtkwidgets_vtkxyplotwidget_Usage}{}\subsection{Usage}\label{vtkwidgets_vtkxyplotwidget_Usage}
The {\ttfamily lower} function converts a string to lower case with the syntax \begin{DoxyVerb}   y = lower(x)
\end{DoxyVerb}
 where {\ttfamily x} is a string, in which case all of the upper case characters in {\ttfamily x} (defined as the range {\ttfamily 'A'-\/'Z'}) are converted to lower case. Alternately, you can call {\ttfamily lower} with a cell array of strings \begin{DoxyVerb}   y = lower(c)
\end{DoxyVerb}
 in which case each string in the cell array is converted to lower case. \hypertarget{variables_struct_Example}{}\subsection{Example}\label{variables_struct_Example}
A simple example\-:


\begin{DoxyVerbInclude}
--> lower('this Is Strange CAPitalizaTion')

ans = 
this is strange capitalization
\end{DoxyVerbInclude}


and a more complex example with a cell array of strings


\begin{DoxyVerbInclude}
--> lower({'This','Is','Strange','CAPitalizaTion'})

ans = 
 [this] [is] [strange] [capitalization] 
\end{DoxyVerbInclude}
 \hypertarget{string_regexp}{}\section{R\-E\-G\-E\-X\-P Regular Expression Matching Function}\label{string_regexp}
Section\-: \hyperlink{sec_string}{String Functions} \hypertarget{vtkwidgets_vtkxyplotwidget_Usage}{}\subsection{Usage}\label{vtkwidgets_vtkxyplotwidget_Usage}
Matches regular expressions in the provided string. This function is complicated, and compatibility with M\-A\-T\-L\-A\-Bs syntax is not perfect. The syntax for its use is \begin{DoxyVerb}  regexp('str','expr')
\end{DoxyVerb}
 which returns a row vector containing the starting index of each substring of {\ttfamily str} that matches the regular expression described by {\ttfamily expr}. The second form of {\ttfamily regexp} returns six outputs in the following order\-: \begin{DoxyVerb}  [start stop tokenExtents match tokens names] = regexp('str','expr')
\end{DoxyVerb}
 where the meaning of each of the outputs is defined below. 
\begin{DoxyItemize}
\item {\ttfamily start} is a row vector containing the starting index of each substring that matches the regular expression.  
\item {\ttfamily stop} is a row vector containing the ending index of each substring that matches the regular expression.  
\item {\ttfamily token\-Extents} is a cell array containing the starting and ending indices of each substring that matches the {\ttfamily tokens} in the regular expression. A token is a captured part of the regular expression. If the {\ttfamily 'once'} mode is used, then this output is a {\ttfamily double} array.  
\item {\ttfamily match} is a cell array containing the text for each substring that matches the regular expression. In {\ttfamily 'once'} mode, this is a string.  
\item {\ttfamily tokens} is a cell array of cell arrays of strings that correspond to the tokens in the regular expression. In {\ttfamily 'once'} mode, this is a cell array of strings.  
\item {\ttfamily named} is a structure array containing the named tokens captured in a regular expression. Each named token is assigned a field in the resulting structure array, and each element of the array corresponds to a different match.  
\end{DoxyItemize}If you want only some of the the outputs, you can use the following variant of {\ttfamily regexp}\-: \begin{DoxyVerb}  [o1 o2 ...] = regexp('str','expr', 'p1', 'p2', ...)
\end{DoxyVerb}
 where {\ttfamily p1} etc. are the names of the outputs (and the order we want the outputs in). As a final variant, you can supply some mode flags to {\ttfamily regexp} \begin{DoxyVerb}  [o1 o2 ...] = regexp('str','expr', p1, p2, ..., 'mode1', 'mode2')
\end{DoxyVerb}
 where acceptable {\ttfamily mode} flags are\-: 
\begin{DoxyItemize}
\item {\ttfamily 'once'} -\/ only the first match is returned.  
\item {\ttfamily 'matchcase'} -\/ letter case must match (selected by default for {\ttfamily regexp})  
\item {\ttfamily 'ignorecase'} -\/ letter case is ignored (selected by default for {\ttfamily regexpi})  
\item {\ttfamily 'dotall'} -\/ the {\ttfamily '.'} operator matches any character (default)  
\item {\ttfamily 'dotexceptnewline'} -\/ the {\ttfamily '.'} operator does not match the newline character  
\item {\ttfamily 'stringanchors'} -\/ the {\ttfamily $^\wedge$} and {\ttfamily \$} operators match at the beginning and end (respectively) of a string.  
\item {\ttfamily 'lineanchors'} -\/ the {\ttfamily $^\wedge$} and {\ttfamily \$} operators match at the beginning and end (respectively) of a line.  
\item {\ttfamily 'literalspacing'} -\/ the space characters and comment characters {\ttfamily \#} are matched as literals, just like any other ordinary character (default).  
\item {\ttfamily 'freespacing'} -\/ all spaces and comments are ignored in the regular expression. You must use '\textbackslash{} ' and '\#' to match spaces and comment characters, respectively.  
\end{DoxyItemize}Note the following behavior differences between M\-A\-T\-L\-A\-Bs regexp and Free\-Mats\-: 
\begin{DoxyItemize}
\item If you have an old version of {\ttfamily pcre} installed, then named tokens must use the older {\ttfamily $<$?P$<$name$>$} syntax, instead of the new {\ttfamily $<$?$<$name$>$} syntax.  
\item The {\ttfamily pcre} library is pickier about named tokens and their appearance in expressions. So, for example, the regexp from the M\-A\-T\-L\-A\-B manual {\ttfamily '(?$<$first$>$\textbackslash{}w+)\textbackslash{}s+(?$<$last$>$\textbackslash{}w+)}(?$<$last$>$\textbackslash{}w+),\textbackslash{}s+(?$<$first$>$\textbackslash{}w+)'$|$ does not work correctly (as of this writing) because the same named tokens appear multiple times. The workaround is to assign different names to each token, and then collapse the results later.  
\end{DoxyItemize}\hypertarget{variables_struct_Example}{}\subsection{Example}\label{variables_struct_Example}
Some examples of using the {\ttfamily regexp} function


\begin{DoxyVerbInclude}
--> [start,stop,tokenExtents,match,tokens,named] = regexp('quick down town zoo','(.)own')
start = 
  7 12 

stop = 
 10 15 

tokenExtents = 
 [1x2 double array] [1x2 double array] 

match = 
 [down] [town] 

tokens = 
 [1x1 cell array] [1x1 cell array] 

named = 
  []
\end{DoxyVerbInclude}
 \hypertarget{string_regexprep}{}\section{R\-E\-G\-E\-X\-P\-R\-E\-P Regular Expression Replacement Function}\label{string_regexprep}
Section\-: \hyperlink{sec_string}{String Functions} \hypertarget{vtkwidgets_vtkxyplotwidget_Usage}{}\subsection{Usage}\label{vtkwidgets_vtkxyplotwidget_Usage}
Replaces regular expressions in the provided string. The syntax for its use is \begin{DoxyVerb}  outstring = regexprep(instring,pattern,replacement,modes)
\end{DoxyVerb}
 Here {\ttfamily instring} is the string to be operated on. And {\ttfamily pattern} is a regular expression of the type accepted by {\ttfamily regexp}. For each match, the contents of the matched string are replaced with the replacement text. Tokens in the regular expression can be used in the replacement text using {\ttfamily \$\-N} where {\ttfamily N} is the number of the token to use. You can also specify the same {\ttfamily mode} flags that are used by {\ttfamily regexp}. \hypertarget{string_strcmp}{}\section{S\-T\-R\-C\-M\-P String Compare Function}\label{string_strcmp}
Section\-: \hyperlink{sec_string}{String Functions} \hypertarget{typecast_dec2bin_USAGE}{}\subsection{U\-S\-A\-G\-E}\label{typecast_dec2bin_USAGE}
Compares two strings for equality. The general syntax for its use is \begin{DoxyVerb}  p = strcmp(x,y)
\end{DoxyVerb}
 where {\ttfamily x} and {\ttfamily y} are two strings. Returns {\ttfamily true} if {\ttfamily x} and {\ttfamily y} are the same size, and are equal (as strings). Otherwise, it returns {\ttfamily false}. In the second form, {\ttfamily strcmp} can be applied to a cell array of strings. The syntax for this form is \begin{DoxyVerb}  p = strcmp(cellstra,cellstrb)
\end{DoxyVerb}
 where {\ttfamily cellstra} and {\ttfamily cellstrb} are cell arrays of a strings to compare. Also, you can also supply a character matrix as an argument to {\ttfamily strcmp}, in which case it will be converted via {\ttfamily cellstr} (so that trailing spaces are removed), before being compared. \hypertarget{variables_struct_Example}{}\subsection{Example}\label{variables_struct_Example}
The following piece of code compares two strings\-:


\begin{DoxyVerbInclude}
--> x1 = 'astring';
--> x2 = 'bstring';
--> x3 = 'astring';
--> strcmp(x1,x2)

ans = 
 0 

--> strcmp(x1,x3)

ans = 
 1 
\end{DoxyVerbInclude}


Here we use a cell array strings


\begin{DoxyVerbInclude}
--> x = {'astring','bstring',43,'astring'}

x = 
 [astring] [bstring] [43] [astring] 

--> p = strcmp(x,'astring')

p = 
 1 0 0 1 
\end{DoxyVerbInclude}


Here we compare two cell arrays of strings


\begin{DoxyVerbInclude}
--> strcmp({'this','is','a','pickle'},{'what','is','to','pickle'})

ans = 
 0 1 0 1 
\end{DoxyVerbInclude}


Finally, the case where one of the arguments is a matrix string


\begin{DoxyVerbInclude}
--> strcmp({'this','is','a','pickle'},['peter ';'piper ';'hated ';'pickle'])

ans = 
 0 0 0 0 
\end{DoxyVerbInclude}
 \hypertarget{string_strcmpi}{}\section{S\-T\-R\-C\-M\-P\-I String Compare Case Insensitive Function}\label{string_strcmpi}
Section\-: \hyperlink{sec_string}{String Functions} \hypertarget{vtkwidgets_vtkxyplotwidget_Usage}{}\subsection{Usage}\label{vtkwidgets_vtkxyplotwidget_Usage}
Compares two strings for equality ignoring case. The general syntax for its use is \begin{DoxyVerb}   p = strcmpi(x,y)
\end{DoxyVerb}
 where {\ttfamily x} and {\ttfamily y} are two strings, or cell arrays of strings. See {\ttfamily strcmp} for more help. \hypertarget{string_strfind}{}\section{S\-T\-R\-F\-I\-N\-D Find Substring in a String}\label{string_strfind}
Section\-: \hyperlink{sec_string}{String Functions} \hypertarget{vtkwidgets_vtkxyplotwidget_Usage}{}\subsection{Usage}\label{vtkwidgets_vtkxyplotwidget_Usage}
Searches through a string for a pattern, and returns the starting positions of the pattern in an array. There are two forms for the {\ttfamily strfind} function. The first is for single strings \begin{DoxyVerb}   ndx = strfind(string, pattern)
\end{DoxyVerb}
 the resulting array {\ttfamily ndx} contains the starting indices in {\ttfamily string} for the pattern {\ttfamily pattern}. The second form takes a cell array of strings \begin{DoxyVerb}   ndx = strfind(cells, pattern)
\end{DoxyVerb}
 and applies the search operation to each string in the cell array. \hypertarget{variables_struct_Example}{}\subsection{Example}\label{variables_struct_Example}
Here we apply {\ttfamily strfind} to a simple string


\begin{DoxyVerbInclude}
--> a = 'how now brown cow?'

a = 
how now brown cow?
--> b = strfind(a,'ow')

b = 
  2  6 11 16 
\end{DoxyVerbInclude}


Here we search over multiple strings contained in a cell array.


\begin{DoxyVerbInclude}
--> a = {'how now brown cow','quick brown fox','coffee anyone?'}

a = 
 [how now brown cow] [quick brown fox] [coffee anyone?] 

--> b = strfind(a,'ow')

b = 
 [1x4 double array] [9] [] 
\end{DoxyVerbInclude}
 \hypertarget{string_strncmp}{}\section{S\-T\-R\-N\-C\-M\-P String Compare Function To Length N}\label{string_strncmp}
Section\-: \hyperlink{sec_string}{String Functions} \hypertarget{typecast_dec2bin_USAGE}{}\subsection{U\-S\-A\-G\-E}\label{typecast_dec2bin_USAGE}
Compares two strings for equality, but only looks at the first N characters from each string. The general syntax for its use is \begin{DoxyVerb}  p = strncmp(x,y,n)
\end{DoxyVerb}
 where {\ttfamily x} and {\ttfamily y} are two strings. Returns {\ttfamily true} if {\ttfamily x} and {\ttfamily y} are each at least {\ttfamily n} characters long, and if the first {\ttfamily n} characters from each string are the same. Otherwise, it returns {\ttfamily false}. In the second form, {\ttfamily strncmp} can be applied to a cell array of strings. The syntax for this form is \begin{DoxyVerb}  p = strncmp(cellstra,cellstrb,n)
\end{DoxyVerb}
 where {\ttfamily cellstra} and {\ttfamily cellstrb} are cell arrays of a strings to compare. Also, you can also supply a character matrix as an argument to {\ttfamily strcmp}, in which case it will be converted via {\ttfamily cellstr} (so that trailing spaces are removed), before being compared. \hypertarget{variables_struct_Example}{}\subsection{Example}\label{variables_struct_Example}
The following piece of code compares two strings\-:


\begin{DoxyVerbInclude}
--> x1 = 'astring';
--> x2 = 'bstring';
--> x3 = 'astring';
--> strncmp(x1,x2,4)

ans = 
 0 

--> strncmp(x1,x3,4)

ans = 
 1 
\end{DoxyVerbInclude}


Here we use a cell array strings


\begin{DoxyVerbInclude}
--> x = {'ast','bst',43,'astr'}

x = 
 [ast] [bst] [43] [astr] 

--> p = strncmp(x,'ast',3)

p = 
 1 0 0 1 
\end{DoxyVerbInclude}


Here we compare two cell arrays of strings


\begin{DoxyVerbInclude}
--> strncmp({'this','is','a','pickle'},{'think','is','to','pickle'},3)

ans = 
 1 0 0 1 
\end{DoxyVerbInclude}


Finally, the case where one of the arguments is a matrix string


\begin{DoxyVerbInclude}
--> strncmp({'this','is','a','pickle'},['peter ';'piper ';'hated ';'pickle'],4);
\end{DoxyVerbInclude}
 \hypertarget{string_strrep}{}\section{S\-T\-R\-R\-E\-P String Replace Function}\label{string_strrep}
Section\-: \hyperlink{sec_string}{String Functions} \hypertarget{vtkwidgets_vtkxyplotwidget_Usage}{}\subsection{Usage}\label{vtkwidgets_vtkxyplotwidget_Usage}
Replace every occurance of one string with another. The general syntax for its use is \begin{DoxyVerb}  p = strrep(source,find,replace)
\end{DoxyVerb}
 Every instance of the string {\ttfamily find} in the string {\ttfamily source} is replaced with the string {\ttfamily replace}. Any of {\ttfamily source}, {\ttfamily find} and {\ttfamily replace} can be a cell array of strings, in which case each entry has the replace operation applied. \hypertarget{variables_struct_Example}{}\subsection{Example}\label{variables_struct_Example}
Here are some examples of the use of {\ttfamily strrep}. First the case where are the arguments are simple strings


\begin{DoxyVerbInclude}
--> strrep('Matlab is great','Matlab','FreeMat')

ans = 
FreeMat is great
\end{DoxyVerbInclude}


And here we have the replace operation for a number of strings\-:


\begin{DoxyVerbInclude}
--> strrep({'time is money';'A stitch in time';'No time for games'},'time','money')

ans = 
 [money is money] 
 [A stitch in money] 
 [No money for games] 
\end{DoxyVerbInclude}
 \hypertarget{string_strstr}{}\section{S\-T\-R\-S\-T\-R String Search Function}\label{string_strstr}
Section\-: \hyperlink{sec_string}{String Functions} \hypertarget{vtkwidgets_vtkxyplotwidget_Usage}{}\subsection{Usage}\label{vtkwidgets_vtkxyplotwidget_Usage}
Searches for the first occurance of one string inside another. The general syntax for its use is \begin{DoxyVerb}   p = strstr(x,y)
\end{DoxyVerb}
 where {\ttfamily x} and {\ttfamily y} are two strings. The returned integer {\ttfamily p} indicates the index into the string {\ttfamily x} where the substring {\ttfamily y} occurs. If no instance of {\ttfamily y} is found, then {\ttfamily p} is set to zero. \hypertarget{variables_struct_Example}{}\subsection{Example}\label{variables_struct_Example}
Some examples of {\ttfamily strstr} in action


\begin{DoxyVerbInclude}
--> strstr('hello','lo')

ans = 
 4 

--> strstr('quick brown fox','own')

ans = 
 9 

--> strstr('free stuff','lunch')

ans = 
 0 
\end{DoxyVerbInclude}
 \hypertarget{string_strtrim}{}\section{S\-T\-R\-T\-R\-I\-M Trim Spaces from a String}\label{string_strtrim}
Section\-: \hyperlink{sec_string}{String Functions} \hypertarget{vtkwidgets_vtkxyplotwidget_Usage}{}\subsection{Usage}\label{vtkwidgets_vtkxyplotwidget_Usage}
Removes the white-\/spaces at the beginning and end of a string (or a cell array of strings). See {\ttfamily isspace} for a definition of a white-\/space. There are two forms for the {\ttfamily strtrim} function. The first is for single strings \begin{DoxyVerb}   y = strtrim(strng)
\end{DoxyVerb}
 where {\ttfamily strng} is a string. The second form operates on a cell array of strings \begin{DoxyVerb}   y = strtrim(cellstr)
\end{DoxyVerb}
 and trims each string in the cell array. \hypertarget{variables_struct_Example}{}\subsection{Example}\label{variables_struct_Example}
Here we apply {\ttfamily strtrim} to a simple string


\begin{DoxyVerbInclude}
--> strtrim('  lot of blank spaces    ');
\end{DoxyVerbInclude}


and here we apply it to a cell array


\begin{DoxyVerbInclude}
--> strtrim({'  space','enough ',' for ',''})

ans = 
 [space] [enough] [for] [] 
\end{DoxyVerbInclude}
 \hypertarget{string_upper}{}\section{U\-P\-P\-E\-R Convert strings to upper case}\label{string_upper}
Section\-: \hyperlink{sec_string}{String Functions} \hypertarget{vtkwidgets_vtkxyplotwidget_Usage}{}\subsection{Usage}\label{vtkwidgets_vtkxyplotwidget_Usage}
The {\ttfamily upper} function converts a string to upper case with the syntax \begin{DoxyVerb}   y = upper(x)
\end{DoxyVerb}
 where {\ttfamily x} is a string, in which case all of the lower case characters in {\ttfamily x} (defined as the range {\ttfamily 'a'-\/'z'}) are converted to upper case. Alternately, you can call {\ttfamily upper} with a cell array of strings \begin{DoxyVerb}   y = upper(c)
\end{DoxyVerb}
 in which case each string in the cell array is converted to upper case. \hypertarget{variables_struct_Example}{}\subsection{Example}\label{variables_struct_Example}
A simple example\-:


\begin{DoxyVerbInclude}
--> upper('this Is Strange CAPitalizaTion')

ans = 
THIS IS STRANGE CAPITALIZATION
\end{DoxyVerbInclude}


and a more complex example with a cell array of strings


\begin{DoxyVerbInclude}
--> upper({'This','Is','Strange','CAPitalizaTion'})

ans = 
 [THIS] [IS] [STRANGE] [CAPITALIZATION] 
\end{DoxyVerbInclude}
 