核对以下编码
def wipe_mutterings_from( sentence )
while sentence.include? (
open = sentence.index( ( )
close = sentence.index( ) , open )
sentence[open..close] = if close
end
end
foo= abbba (jjjj) kkkkkk
wipe_mutterings_from( foo )
p foo
In my understanding I have passed the string by ref to the function (much like is done in lower level languages like c/cpp).
Is it possible to pass the string only by value (like in PHP)?
I am fully aware I can duplicate the string inside the function and work only on the copy.