help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Constants][Types][Classes][Procedures and functions][Variables] Reference for unit 'System' (#rtl)

StringOfChar

Return a string consisting of 1 character repeated N times.

Declaration

Source position: systemh.inc line 577

function StringOfChar(

  c: Char;

  l: SizeInt

):AnsiString;

Description

StringOfChar creates a new String of length l and fills it with the character c.

It is equivalent to the following calls:

SetLength(StringOfChar,l);
FillChar(Pointer(StringOfChar)^,Length(StringOfChar),c);

Errors

None.

See also

SetLength

  

Set length of a string.

Example

Program Example97;

{$H+}

{ Program to demonstrate the StringOfChar function. }

Var S : String;

begin
  S:=StringOfChar(' ',40)+'Aligned at column 41.';
  Writeln(s);
end.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505