String Data Type
The document is archived and information here might be outdated

String Data Type

The length of a String can be from zero to approximately two billion characters. Each character is a 16-bit Unicode value.

The equivalent .NET Framework data type is System.String.

Remarks

The properties and methods of the String data type are the same as the System.String properties and methods.

JScript also defines a String object, which provides different properties and methods from the String data type. You cannot create properties or add methods to variables of the String data type, while you can for instances of the String object.

The String object interoperates with String data. Consequently, a String object can call the methods and properties of the String data type, and a String data type can call the methods and properties of the String object. For additional information, see String Object Properties and Methods. Furthermore, String objects are accepted by functions that take String data types, and vice versa.

Escape sequences can be used in string literals to represent special characters that cannot be used directly in a string, such as the newline character or Unicode characters. When a script is compiled, each escape sequence in a string literal is converted into the characters it represents. For additional information, see String Data.

JScript does not interpret special Unicode sequences, such as surrogate pairs, nor does it normalize strings when comparing them.

Note   Pairs of Unicode characters that represent a single character and only have meaning when combined are known as surrogate pairs.

Some characters can be represented by more than one sequence of Unicode characters. Separate normalized sequences are interpreted identically if they represent the same character.

Properties and Methods

String Members

Requirements

Version .NET

See Also

Data Types | Data Type Summary | String Object | String Class | char Data Type | String Data

Show:
© 2016 Microsoft