Skip to content

Strings

Built-in functions › Programming and data types › Strings

39 functions in this category.

FunctionWhat it does
appendConcatenate strings without trimming.
assertAssert that a condition is true; throw an error if not.
blanksString of n space characters.
dealDistribute multiple inputs to multiple outputs.
deblankRemove trailing whitespace from a string.
epsFloating-point relative accuracy (machine epsilon).
eraseRemove all occurrences of a pattern from a string.
eraseBetweenRemove the substring between two boundary patterns.
evalExecute a string as MathJet code.
evalcEvaluate a string and capture its console output.
evalinEvaluate a string in a different workspace.
findstrFind one string within another (returns positions of all occurrences).
inputPrompt the user for input from the console.
inputnameVariable name of a function argument from the caller’s perspective.
ischarTest whether the input is a character array.
isletterTest whether each character is alphabetic.
isspaceTest whether each character is whitespace.
isstrpropTest whether characters belong to a named character category.
joinJoin an array of strings into a single string.
lowerConvert string to lowercase.
newlineThe newline character (\n).
piMathematical constant π.
realmaxLargest positive finite floating-point number.
realminSmallest positive normalized floating-point number.
regexpMatch a regular expression against a string.
regexpiMatch a regular expression against a string (case-insensitive).
reverseReverse the order of characters in a string.
sprintfFormat data into a string.
strcatConcatenate strings horizontally.
strcmpCompare strings for equality (case-sensitive).
strcmpiCompare strings for equality (case-insensitive).
strfindFind one string within another.
strncmpCompare the first n characters of two strings (case-sensitive).
strncmpiCompare the first n characters of two strings (case-insensitive).
strrepReplace all occurrences of a substring.
strtrimRemove leading and trailing whitespace from a string.
strtruncTruncate a string to a specified length.
strvcatConcatenate strings vertically (pad to equal length).
upperConvert string to uppercase.