Categories &

Functions List

Class Definition: string

datatypes: string

Array representing sequences of characters.

A string array is an array, where each element stores a sequence of characters of arbitrary length.

A string array can also have missing elements, which differ from a sequence of characters of zero length (the equivalent of an empty character vector).

To enable existing functions to handle string arrays as if they were cell arrays of character vectors or character arrays, use the convertCharsToStrings function inside your code. To enable functions working with string arrays to accept cell arrays of character vectors or character vectors as if they were string arrays or string scalars, use the convertStringsToChars function.

See also: convertCharsToStrings, convertStringsToChars

Source Code: string

The string class offers the following public methods:

string Create a new string array.
dispstrings Get display formatted strings for each element of a string object.
cellstr Convert string array to a cell array of character vectors.
cell Convert string array to a cell array.
char Convert string array to a character matrix.
double Convert string array to a double array.
size Return the size of a string array.
ndims Number of dimensions in a string array.
numel Total number of elements in a string array.
length Length of a string vector.
strlength Length of text in string arrays.
count Count occurences of pattern in string array.
keyHash Generate a hash code for string array.
contains Test if strings contain pattern.
endsWith Test if strings end with pattern.
startsWith Test if strings start with pattern.
matches Test if strings match pattern.
iscolumn Test if string array is a column vector.
isempty Test if string array is empty.
ismatrix Test if string array is a matrix.
ismember Find string elements in a set.
ismissing Find missing elements in string array.
isrow Test if string array is a row vector.
isscalar Test if string array is a scalar.
issorted Return true if string array is sorted.
issortedrows Return true if string matrix rows are sorted.
isstring Test for string array.
isvector Test if string array is a vector.
eq Test for equality.
ge Test for greater than or equal to.
gt Test for greater than.
le Test for less than or equal to.
lt Test for less than.
ne Test for inequality.
strcmp Compare strings.
strcmpi Compare strings (case insensitive).
strncmp Compare first N characters of strings.
strncmpi Compare first N characters of strings (case insensitive).
append Combine string arrays.
compose Format data into a string array or translate escape-character sequences.
erase Remove content from string array.
eraseBetween Erase content between start and end boundaries.
extract Extract substrings from a string array.
extractAfter Extract the substring after a position or pattern.
extractBefore Extract the substring before a position or pattern.
extractBetween Extract the substrings between start and end boundaries.
insertAfter Insert text after a pattern or position.
insertBefore Insert text before a pattern or position.
replace Replace substrings in string array.
replaceBetween Replace content between start and end boundaries.
reverse Reverse order of characters in string array.
sort Sort elements in a string array.
sortrows Sort rows in a string array.
split Split string array at delimiters.
splitlines Split string array at newline characters.
strcat Horizontal concatenation of texts in string array.
strip Remove leading and trailing characters from string array.
pad Add leading or trailing characters to string array.
join Combine string array elements.
plus Append strings.
lower Convert contents of string array to lower case.
upper Convert contents of string array to upper case.
unique Unique values in a string array.
cat Concatenate string arrays.
horzcat Horizontal concatenation of string arrays.
vertcat Vertical concatenation of string arrays.
repmat Repeat copies of a string array.
repelem Repeat copies of string array elements.
repelems Construct a vector of repeated elements from a string array.
reshape Reshape string array.
circshift Circularly shift the elements in a string array.
permute Generalized transpose for a string N-D array.
ipermute Inverse of the generalized transpose for a string N-D array.
transpose Transpose a string matrix.
ctranspose Transpose a string matrix.