System.UnicodeString

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

type UnicodeString = { built-in type };

C++

class RTL_DELPHIRETURN UnicodeString

Properties

Type Visibility Source Unit Parent
type
class
public
System.pas
ustring.h
System System

Description

UnicodeString is the C++ analog for the Delphi UnicodeString type.

Delphi utilizes several string types. UnicodeString can contain both Unicode and ANSI strings, ANSI strings being converted first. Support for this type includes the following features:

  • Strings as large as available memory.
  • Efficient use of memory through shared references.
  • Routines and operators that evaluate strings based on the current locale.

Despite its name, UnicodeString can represent both Unicode strings and ANSI strings, ANSI strings being converted first.

UnicodeString variables that have not been assigned an initial value contain a zero-length string.

Note: Delphi also supports UnicodeString, but implements it as a primitive type rather than a class. By default, variables declared as type String are UnicodeString.

Note: To be compatible with Delphi desktop compilers, UnicodeString indexing is 1-based. If you are using Delphi mobile compilers, UnicodeString indexing is 0-based; for more information, see Migrating Delphi Code to Mobile from Desktop.

See Also