Chapter 3 DynaScript Predefined Objects


String object

Object

Enables manipulation and formatting of strings as objects and objects as strings.

Standard: ECMAScript

Syntax

To use a String method:

String.MethodName( parameter ) 

Description

You can call String object as a function:

String( value ); 

or as a constructor:

myString = new String( value );

When called as a function, a type conversion is performed and a string is returned. A new String object is not created. When a String object is created through a constructor a String object is returned.

Example

This example creates a new String object:

<!--SCRIPT 
myString = new String( "hello" );
document.WriteLn( myString );
-->

 


Copyright © 1999 Sybase, Inc. All rights reserved.