Siebel eScript Language Reference > Methods Reference > String Methods >

Overview of String Methods


The value property of a string object describes a sequence of text characters. In this topic, the term string represents the value of an instance of the string object. Other properties of the string object describe the string value and methods of the string object that manipulate the string value.

To indicate that a text literal is a string, you enclose it with quotation marks. In the following example, the first statement places the hello string in the word variable. The second statement sets the word variable to have the same value as the hello variable:

var word = "hello";
word = hello;

To declare a string you can use single quotes instead of double quotes. No difference exists between these quotes in Siebel eScript.

This topic uses the following formats:

  • stringVar. Indicates a string variable. To use a property or to call a method, a specific instance of a variable must precede the period.
  • String name. Indicates a static method of the string object. It does not apply to a specific instance of the string object.

How Siebel eScript Handles Special Characters In a String

A quotation mark is an example of a special character. To use a special character in a string, you must use a specific combination of characters that represent the special character. This combination allows Siebel CRM to understand how you intend it to use the character. For example, a quotation mark that is part of a string or a quotation mark that marks the end of the string.

Table 34 lists the character combinations that represent special characters. You cannot write code that uses these character combinations in a string that is enclosed by back quotes. For more information, see Back Quote Usage in a String.

Table 34. Character Combinations That Represent Special Characters
Character Combination
Special Character That the Character Combination Represents

\a

Audible bell.

\b

Backspace.

\f

Form feed.

\n

Newline.

\r

Carriage return.

\t

Tab.

\v

Vertical tab.

\'

Single quote.

\"

Double quote.

\\

Backslash character.

\0###

Octal number. For example: '\033' is the octal number.

\x##

Hex number. For example: '\x1B' is the hex number.

\0

Null character. For example: '\0' is the null character.

\u####

Unicode number. For example: '\u001B' is the Unicode number.

Back Quote Usage in a String

To configure Siebel eScript to not translate a character combination that typically represents a special character, you can use the following back quote:

`

If you use the back quote, then Siebel eScript interprets the character combination as a part of the string. For example, the following code lines illustrate different ways to reference a file name:

"c:\\autoexec.bat" // traditional C method
'c:\\autoexec.bat' // traditional C method
`c:\autoexec.bat'   // alternative Siebel eScript method

If a string includes a back quote, then you cannot include a special character that is represented by a back slash followed by a letter in that string. For example, \n.

Most versions of JavaScript do not support a string that includes a back quote. If you plan to use your script in some form of JavaScript other than Siebel eScript, then do not use back quotes.

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