This task performs basic string operations. For example, this task can be useful in the Modeler when working with filenames.
Example
Str = 'This is a vector.'
Task = ENVITask('StringProcessing')
Task.INPUT_STRING = Str
Task.OPERATION = 'Replace'
Task.REPLACING_STRINGS = ['vector', 'raster']
Task.Execute
print, Task.OUTPUT_STRING
Syntax
Result = ENVITask('StringProcessing')
Input parameters (Set, Get): CONCATENATE_STRING, FOLD_CASE, INPUT_STRING, OPERATION, REPLACING_STRINGS
Output parameters (Get only): OUTPUT_STRING
Parameters marked as "Set" are those that you can set to specific values. You can also retrieve their current values any time. Parameters marked as "Get" are those whose values you can retrieve but not set.
Input Parameters
CONCATENATE_STRING (optional)
Set the string to concatenate to the input string. Specify a value if the OPERATION is Concantenante.
FOLD_CASE (optional)
Set this parameter to true to ignore case when replacing strings. Specify a value if the OPERATION is Replace.
INPUT_STRING (required)
Specify the input string to process.
OPERATION (required)
Specify the operation to be performed on the input string.
-
To Lower: Change string to lower case.
-
To Upper: Change string to upper case.
-
Trim: Remove any leading and trailing spaces or tabs from the string.
-
Replace: Replace current string with specified string.
-
Concatenate: Join strings into one.
-
Remove Extension: Remove the extension from filename string.
-
Extract Directory: Extract directory name from file path string.
-
Extract Basename: Extract filename from file path string.
-
Extract Extension: Extract extension from filename string.
REPLACING_STRINGS (optional)
Specify an array of two strings (string-to-be-replaced, replacing-string). Specify a value if the OPERATION is Replace.
Output Parameters
OUTPUT_STRING
Output string obtained from processing.
Methods
Execute
Parameter
ParameterNames
Properties
DESCRIPTION
DISPLAY_NAME
NAME
REVISION
TAGS
Version History