Hi there,

I encountered the call-by-reference problem, which was discussed before
in this group. Please have a look at the following code:

def test!(str)
  str=str.upcase
end
str="hello"
print str,"\n"
test!(str)
print str,"\n"

The str is not turned into upcase. This seems clear since that "Ruby
only pass by value". According to a post in this group, I tried change
the parameter into an array, and it worked.

The problem here is, we have seen some Ruby methods, like String.chomp!
and many that end with a !, they can modify parameters in place, how is
it done?? Is it possible to do this in programming, or is it only
available in standard libraries, which may be implemented outside of
ruby (eg. in C)?

tks
Shannon