String Functions

The following functions are useful when working with strings:

concat(S1, S2, S3, ...) Returns the string formed by concatenating strings S1, S2, and so on.

substr(S, m, n) Returns the substring of S having n characters starting at position m.

search(S, SubS, m) Returns the starting position of the substring SubS in S, beginning from position m in S. If the substring is not found after the specified starting position, it returns either −1 or ORIGIN-1, depending on whether strings are indexed to ORIGIN or not.

strlen(S) Returns the integer number of characters in S.

num2str(z) Converts a scalar z into a string.

format(Sf, x1, x2, x3, ...) Returns a string containing the value of the arguments x1, x2, x3, ... with print order and surrounding text specified by Sf.

str2num(Sn) Converts a string of numbers Sn into a constant.

str2vec(S) Converts a string S to a vector of ANSI codes.

vec2str(v) Converts a vector of integer ANSI codes to a string.

IsString(x) Returns 1 if x is a string, otherwise returns 0. This function is most useful inside the conditional statement of a program.

error(S) Returns the string S as an error message. Typically used in a program. S may contain the characters \n, which cause the resulting error message to wrap to a new line.

Arguments:

Notes:

QuickSheet