|
This function returns a substring of an input string. This function requires information on the start position and the length of the desired substring. |
||||||||||||
Syntax: |
|||||||||||||
{STR_VAR}= strpart({STR_EXPR},{NUM_EXPR},{NUM_EXPR}) | |||||||||||||
I/O parameters:
|
|||||||||||||
Return value: |
|||||||||||||
|
|||||||||||||
Example: |
|||||||||||||
Declaration of Variables | |||||||||||||
10 ask(DOCU_STRING_1,"File name?") 20 DOCU_INT_1 = strchr(DOCU_STRING_1,".") 30 DOCU_STRING_2 = strpart(DOCU_STRING_1,1,DOCU_INT_1-1) 40 put(DOCU_STRING_2) |
|||||||||||||
Result: (For DOCU_STRING_1 = test.file) | |||||||||||||
In this example the file extension and the dot (.file) are truncated from a file name (test.file). |
|||||||||||||
![]() |
Functions and commands: Editing Strings |