Msg:='!md5 12345'; If (pos('!md5',Msg) = 1) and (length(Msg)>5) then begin pass:=copy(Msg,6,length(Msg)-5); hash:=GetMd5(pass); end;