Advertisement
DevTricks

Замена слов в строке. Массивы

Dec 25th, 2022
1,968
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ArrIn  := ["девчонку", "пелёнку", "Иван"]
  2. ArrOut := ["демона", "топор", "Олег"]
  3. Str = Иван родил девчонку, велел тащить пелёнку.
  4.  
  5. MsgBox, , Входная строка, %Str%
  6.  
  7. Loop % ArrIn.MaxIndex()
  8. {
  9.     StringReplace, Str, Str,% ArrIn[A_Index],% ArrOut[A_Index], All
  10. }
  11.  
  12. MsgBox, , Выходная строка, %Str%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement