This task performs basic string operations. For example, this task can be useful in the Modeler when working with filenames.

Example


; Define the input
Str = 'This is a vector.'
 
; Get the task from the catalog of ENVITasks
Task = ENVITask('StringProcessing')
 
; Define inputs
Task.INPUT_STRING = Str
Task.OPERATION = 'Replace'
Task.REPLACING_STRINGS = ['vector', 'raster']
 
; Run the task
Task.Execute
 
; Display the result
print, Task.OUTPUT_STRING

Syntax


Result = ENVITask('StringProcessing')

Input properties (Set, Get): CONCATENATE_STRING, FOLD_CASE, INPUT_STRING, OPERATION, REPLACING_STRINGS

Output properties (Get only): OUTPUT_STRING

Properties marked as "Set" are those that you can set to specific values. You can also retrieve their current values any time. Properties marked as "Get" are those whose values you can retrieve but not set.

Methods


This task inherits the following methods from ENVITask:

AddParameter

Execute

Parameter

ParameterNames

RemoveParameter

Properties


This task inherits the following properties from ENVITask:

COMMUTE_ON_DOWNSAMPLE

COMMUTE_ON_SUBSET

DESCRIPTION

DISPLAY_NAME

NAME

REVISION

TAGS

This task also contains the following properties:

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.

OUTPUT_STRING

Output string obtained from processing.

REPLACING_STRINGS (optional)

Specify an array of two strings (string-to-be-replaced, replacing-string). Specify a value if the OPERATION is Replace.

Version History


ENVI 5.7

Introduced

API Version


4.3

See Also


ENVITask