SiebelDecodeJsString Function

Action

Replaces escape sequences in a string, as used within JavaScript strings, with the corresponding control characters.

Include file

Siebel7Web.bdh

Syntax

SiebelDecodeJsString( inout sString : string ) : string;

Return value

Original string with escape sequences replaced by the corresponding control characters.

Parameter Description
sString Any string.

The following two-character sequences are replaced by the corresponding control character:

"\n" replaced by a newline character

"\r" replaced by a carriage return character

"\t" replaced by a tab character

"\f" replaced by a form feed character

Example

transaction TDecodeJs
  var
    sString : string;
  begin
    sString := "First Line\\r\\n\\tSecond line indented with tab\\r\\nThirdLine";
    Writeln("Original:\n-----\n" + sString + "\n-----");
    Writeln("Decoded:\n-----\n" + SiebelDecodeJsString(sString) + "\n-----");
  end TDecodeJs;

Output

Original:
-----
First Line\r\n\tSecond line indented with tab\r\nThirdLine
-----
Decoded:
-----
First Line
Second line indented with tab
ThirdLine
-----