Scilab 5.3.3
- Scilab help
- Strings
- ascii
- blanks
- code2str
- convstr
- emptystr
- eval
- evstr
- grep
- isalphanum
- isascii
- isdigit
- isletter
- isnum
- justify
- length
- part
- regexp
- sci2exp
- str2code
- strcat
- strchr
- strcmp
- strcmpi
- strcspn
- strindex
- string
- strings
- stripblanks
- strncpy
- strrchr
- strrev
- strsplit
- strspn
- strstr
- strsubst
- strtod
- strtok
- tokenpos
- tokens
- tree2code
Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function
part
extraction of strings
Calling Sequence
[strings_out] = part(strings_in, v)
Arguments
- strings_in, strings_out
Matrix of character strings.
- v
Integer row vector.
Description
Let s[k]
stands for the k
character of string s
( or the white space character if
k >length(s)
).
part
returns strings_out
, a
matrix of character strings, such that strings_out(i,j)
is the string "s[v(1)]...s[v(n)]"
(
s=strings_in(i,j)
).
Examples
// returns characters position 8 to 11 part("How to use ""part"" ?",8:11) // returns characters position 2 to 4 for each element // no characters replaced by '' c = part(['a','abc','abcd'],2:4) // returns character position 1 for each element and add characters position 4 to 7 of each element c = part(['abcdefg','hijklmn','opqrstu'],[1,4:7]); // returns character 4 for each element, add characters position 1 to 7 and add character position 4 for each element c = part(['abcdefg','hijklmn','opqrstu'],[4,1:7,4]); // returns character position 1,add again character position 1 and character position 2 c=part(['a','abc','abcd'],[1,1,2]) // a a a part(['a','abc','abcd'],[1]) // aa aa aa part(['a','abc','abcd'],[1,1]) // aa aab aab part(['a','abc','abcd'],[1,1,2])
<< length | Strings | regexp >> |