unit SystemPos;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

// BeginExample: SystemPos
// Routine: System.Pos

// BeginCode
{
This example demonstrates how to edit particular elements of a string.
}
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;
// EndCode
// EndExample: SystemPos
end.
