A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
16
Task/Binary-strings/Icon/binary-strings-2.icon
Normal file
16
Task/Binary-strings/Icon/binary-strings-2.icon
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
procedure replace(s1, s2, s3) #: string replacement
|
||||
local result, i
|
||||
|
||||
result := ""
|
||||
i := *s2
|
||||
if i = 0 then fail # would loop on empty string
|
||||
|
||||
s1 ? {
|
||||
while result ||:= tab(find(s2)) do {
|
||||
result ||:= s3
|
||||
move(i)
|
||||
}
|
||||
return result || tab(0)
|
||||
}
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue