Удаление подтекста из заданного текста — Pascal(Паскаль)

Program Pro_47 (Input, Output);
Var 
Text, T : String; 
i : Integer;
 
Begin
 
WriteLn ('PASCAL: Удаление подтекста из заданного текста.'); 
Write ('Введите текст Text: ');
ReadLn (Text);
Write ('Введите подтекст T: ');
ReadLn (T); 
 
While i <= Length (Text) - Length (T) + 1Do
Begin
If Copy (Text, i, Length (T) ) = T 
Then Delete (Text, i, Length (T) )
Else i := i + 1; 
End;
 
WriteLn ('Полученный текст: ', Text);
 
ReadLn;
End. 

Leave a Comment

61 − = 55