Seiki Batch Script > String Functions

$select

Returns a string containing a specified number of characters from a string

Class: String

Parameters:  $string – String from which characters are returned

                     start – Integer indicating the start position index within $string. d is 0 based

                     length (Optional) – Integer indicating how many characters to return

Syntax: $returnString=$select($string, start [,length])

Returns:

      If start≥length of $string - A zero-length string

      If length≤0 - A zero-length string

      If length is omitted - A single character string of at index start

      Else - A string containing length characters from index start

Remarks: Set length to a large arbitrary number (e.g. 999) to select all characters from index start to end of $string

Example:

//Example for the string $left method

$s=”SEIKI BATCH SCRIPT” //Set string

$result=$select($s, 6, 5) //Result (= ‘BATCH’)

message(“Selected 5 characters of “ + $s + “ are “ + $result) //Display results message

 

See Also:    $left

                  $right