function InsertChar(s:string;idx:integer;ch:char):string; var tmp:string; begin tmp:=copy(s,0,idx); tmp:=tmp+ch; tmp:=tmp+copy(s,idx,length(s)); InsertChar:=tmp; end;