Freeze a string : freeze « String « Ruby






Freeze a string


greet = "Hello, myValue!"
greet.freeze

 








Related examples in the same category

1.Make a string immutable with Object's freeze method
2.is the object frozen?
3.can't modify frozen string
4.rescue a Attempting-to-modify exception