Udostępnij za pośrednictwem


String Data Type (Visual Studio - JScript)

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 String.

Remarks

The properties and methods of the String data type are the same as the 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

Requirements

Version .NET

See Also

Concepts

Data Type Summary

String Data

Reference

String Object

char Data Type (Visual Studio - JScript)

Other Resources

Data Types (Visual Studio - JScript)