RosettaCodeData/Task/String-interpolation--included-/Icon/string-interpolation--included-.icon

6 lines
289 B
Text
Raw Permalink Normal View History

2013-04-11 01:07:29 -07:00
s2 := "humongous"
s3 := "little"
s1 := "Mary had a humongous lamb."
s1 ?:= tab(find(s2)) || (=s2,s3) || tab(0) # replaces the first instance of s2 with s3
while s1 ?:= tab(find(s2)) || (=s2,s3) || tab(0) # replaces all instances of s2 with s3, equivalent to replace