Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Group: String Manipulation
See also: atof string

Function: substr
Description: substr extracts a substring from a string.

Usage: z = string (str, from, to)
Input:
str n x 1 string vector
from n x 1 vector
to n x 1 vector
Output:
z n x 1 string vector

Example:



fmt = "Number  : %10.3f"

i   = 1:10

str = string (fmt, i)

str = substr (str, i, i+10)

str

Result:



Contents of str

[ 1,] "Number  : "

[ 2,] "umber  :  "

[ 3,] "mber  :   "

[ 4,] "ber  :    "

[ 5,] "er  :     "

[ 6,] "r  :      "

[ 7,] "  :      7"

[ 8,] " :      8."

[ 9,] ":      9.0"

[10,] "     10.00"


Group: String Manipulation
See also: atof string

Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

(C) MD*TECH Method and Data Technologies, 21.9.2000