LOVEGUN

Chef D'oeuvre

Mar 5th, 2021 (edited)
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.59 KB | None | 0 0
  1. Function propre (ch1,ch2:String): String;
  2. Var
  3.   ch: String;
  4. Begin
  5.   ch := ch1+'*';
  6.   ch2 := ch2+'*';
  7.   Repeat
  8.     If Pos(Copy(ch2,1,Pos('_',ch2)),ch)=0 Then
  9.       Begin
  10.         ch := ch+Copy(ch2,1,Pos('*',ch2)-1)+'*';
  11.         Delete (ch2,1,Pos('*',ch2));
  12.       End
  13.     Else
  14.       If Copy(ch2,Pos('_',ch2)+1,1)>Copy (ch,Pos(Copy(ch2,1,2),ch)+2,1) Then
  15.         Begin
  16.           Delete (ch,Pos(Copy(ch2,1,2),ch),4);
  17.           ch := ch+Copy(ch2,1,3)+'*';
  18.           Delete (ch2,1,Pos('*',ch2));
  19.         End
  20.     Else
  21.       Delete (ch2,1,Pos('*',ch2));
  22.   Until (ch2='');
  23.   propre := ch;
  24. End;
Add Comment
Please, Sign In to add comment