Function Reference

Strings

Creating Strings

blanks
Return a string of N blanks.
char
Create a string array from a numeric matrix, cell array, or list of
strcat
Return a string containing all the arguments concatenated.
strvcat
Return a matrix containing the strings (and cell-strings) S_1, .
strtrunc
Truncate the character string S to length N.
string_fill_char
Query or set the internal variable used to pad all rows of a character matrix to the same length.
str2mat
Return a matrix containing the strings S_1, .
ischar
Return 1 if A is a string.
mat2str
Format real/complex numerical matrices as strings.
num2str
Convert a number to a string.
int2str
Convert an integer to a string.

Comparing Strings

strcmp
Return 1 if the character strings S1 and S2 are the same, and 0 otherwise.
strcmpi
Ignoring case, return 1 if the character strings S1 and S2 are the same, and 0 otherwise.
strncmp
Return 1 if the first N characters of strings S1 and S2 are the same, and 0 otherwise.
strncmpi
Ignoring case, return 1 if the first N characters of character strings S1 and S2 are the same, and 0 otherwise.
validstring
Not implemented.

Manipulating Strings

deblank
Remove trailing blanks and nulls from S.
findstr
Return the vector of all positions in the longer of the two strings S and T where an occurrence of the shorter of the two starts.
index
Return the position of the first occurrence of the string T in the string S, or 0 if no occurrence is found.
rindex
Return the position of the last occurrence of the character string T in the character string S, or 0 if no occurrence is found.
strfind
Search for PATTERN in the string STR and return the starting index of every such occurrence in the vector IDX.
strmatch
Return indices of entries of A that match the string S.
strtok
Find all characters up to but not including the first character which is in the string delim.
split
Divides the string S into pieces separated by T, returning the result in a string array (padded with blanks to form a valid matrix).
strrep
Replaces all occurrences of the substring X of the string S with the string Y.
substr
Return the substring of S which starts at character number OFFSET and is LEN characters long.
regexp
Regular expression string matching.
regexpi
Case insensitive regular expression string matching.
regexprep
Replace matches of PAT in STRING with REPSTR.
regexptranslate
Translate a string for use in a regular expression.

String Conversions

bin2dec
Return the decimal number corresponding to the binary number stored in the string S.
dec2bin
Return a binary number corresponding the nonnegative decimal number N, as a string of ones and zeros.
dec2hex
Return the hexadecimal string corresponding to the nonnegative integer N.
hex2dec
Return the integer corresponding to the hexadecimal number stored in the string S.
dec2base
Return a string of symbols in base B corresponding to the nonnegative integer N.
base2dec
Convert S from a string of digits of base B into an integer.
num2hex
Typecast a double precision number or vector to a 16 character hexadecimal string of the IEEE 754 representation of the number.
hex2num
Typecast the 16 character hexadecimal character matrix to an IEEE 754 double precision number.
str2double
Convert strings into numeric values.
strjust
Shift the non-blank text of S to the left, right or center of the string.
str2num
Convert the string S to a number.
toascii
Return ASCII representation of S in a matrix.
tolower
Return a copy of the string S, with each upper-case character replaced by the corresponding lower-case one; nonalphabetic characters are left unchanged.
toupper
Return a copy of the string S, with each lower-case character replaced by the corresponding upper-case one; nonalphabetic characters are left unchanged.
do_string_escapes
Convert special characters in STRING to their escaped forms.
undo_string_escapes
Converts special characters in strings back to their escaped forms.

Character Class Functions

isalnum
Return 1 for characters that are letters or digits (`isalpha (S)' or `isdigit (S)' is true).
isalpha
Return true for characters that are letters (`isupper (S)' or `islower (S)' is true).
isascii
Return 1 for characters that are ASCII (in the range 0 to 127 decimal).
iscntrl
Return 1 for control characters.
isdigit
Return 1 for characters that are decimal digits.
isgraph
Return 1 for printable characters (but not the space character).
isletter
Returns true if S is a letter false otherwise.
islower
Return 1 for characters that are lower case letters.
isprint
Return 1 for printable characters (including the space character).
ispunct
Return 1 for punctuation characters.
isspace
Return 1 for whitespace characters (space, formfeed, newline, carriage return, tab, and vertical tab).
isupper
Return 1 for upper case letters.
isxdigit
Return 1 for characters that are hexadecimal digits.
isstrprop
Test character string properties.