System.StringOfChar

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function StringOfChar(Ch: WideChar; Count: Integer): UnicodeString; overload;
function StringOfChar(Ch: _AnsiChr; Count: Integer): _AnsiStr; overload;

C++

extern DELPHI_PACKAGE UnicodeString __fastcall StringOfChar(WideChar Ch, int Count)/* overload */;

Properties

Type Visibility Source Unit Parent
function public
System.pas
System.hpp
System System

Description

Returns a string with a specified number of repeating characters.

In Delphi code, StringOfChar returns a string that contains Count characters, with the character value given by Ch. For example,

S := StringOfChar('A', 10);

sets S to the string 'AAAAAAAAAA'.

Note that StringOfChar returns the same type as ch: either an AnsiString or UnicodeString, so it works properly for both types.

See Also