SystemPos (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This example demonstrates how to edit particular elements of a string.

Code

procedure TForm1.Button1Click(Sender: TObject);
var S: string;
begin
  S := Edit1.Text;
  { Convert spaces to zeros }
  while Pos(' ', S) > 0 do
    S[Pos(' ', S)] := '0';
  Edit1.Text := S;
end;

Uses

Personal tools
Assistance