Format(‘%-35s’,[MyString])
//   Where 35 is the length to make the string
//   And MyString is the string to format
Formatting numbers :
[code lang=”delphi”] Var
  I : Integer;
  S : String;
begin
 I := StrToInt(Edit1.Text); // Get a number
  FmtStr(S, ‘%.3d’, [I]);
 Edit2.Text := S; // write out the string representation of it.
// I.E. If Edit1.Text := ‘1’ Then Edit2.Text := ‘001’;
end;
[/code]
[tags]Delphi, Strings[/tags]
0 Kommentare zu “Formatting”