Copy a string: Difference between revisions

Line 260:
assert string == stringCopy // they have equal values
assert ! string.is(stringCopy) // they are references to different objects (like Java !=)</lang>
 
'''Caveat Lector''': Strings are immutable objects in Groovy, so it is wasteful and utterly unnecessary to ever make copies of them within a Groovy program.
 
=={{header|Haskell}}==
Anonymous user