Siebel eScript Language Reference > Methods Reference > String Methods >

Parse String Method


The Parse String method parses a string into an array of strings according to the delimiters that you specify in the delimiter argument. Note the following:

  • It returns an array of strings, each of which begins at an instance of the delimiter character.
  • It does not include the delimiter in any of the strings.
  • If you do not specify the delimiter argument or if this argument contains an empty string (""), then it returns an array of one element, which includes the original string.
  • It is the inverse of arrayVar.join.

For more information, see Create Array Elements Method.

Format

stringVar.split([delimiter])

Table 40 describes the arguments for the Parse String method.

Table 40. Arguments for the Parse String Method
Argument
Description

delimiter

The character where this method splits the value stored in stringVar.

Example

The following example splits a typical Siebel command line into separate elements. It creates a separate array element at each space character. You must configure Siebel CRM to modify the string with character combinations so that Siebel eScript can understand it. The cmdLine variable must occur on a single line. In this book this variable wraps to a second line:

function Button3_Click ()
{
   var msgText = "The following items occur in the array:\n\n";
   var cmdLine = "C:\\Siebel\\bin\\siebel.exe /c
\'c:\\siebel\\bin\\siebel.cfg\' /u SADMIN /p SADMIN /d Sample"
   var cmdArray = cmdLine.split(" ");
   for (var i = 0; i < cmdArray.length; i++)
      msgText = msgText + cmdArray[i] + "\n";
   TheApplication().RaiseErrorText(msgText);
}

This example produces the following result:

The following items occur in the array:
C:\Siebel\bin\siebel.exe
/c
'C:\siebel\bin\siebel.cfg'
/u
SADMIN
/p
SADMIN
/d
Sample

Siebel eScript Language Reference Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.