String - Overview

The String object allows you to manipulate strings (i.e. alphanumeric characters surrounded by quite marks in a variable) in your script. These functions are all methods or properties of String objects, which means that in the script they must be called as follows:

MyString.functionName

This means, type the name of the string object followed by the name of one of the OpusScript functions listed below separated by a full stop, For example:

MyString.charAt(3)

Hierarchy:

Only the specific functions listed under the Functions: heading below can be used with String objects:

Class Hierarchy:

String

Hierarchy of objects in Opus

Functions:

charAt

Get the character at the specified position in the string

charCodeAt

Get the character code at the specified position in the string

indexOf

Return the position within the String object of the substring

lastIndexOf

Return the position within the String object of the last match in the substring

length

The length of the string

split

Split a String object into an array of strings

substring

Returns a substring of a specified string

toLowerCase

Converts the String object to lower case

toString

Converts the String object into a string

toUpperCase

Converst the String object to upper case

valueOf

Returns the primative value of the String object