From: tamouse mailing lists Date: 2013-04-26T21:30:45+09:00 Subject: Re: Store/Delete a string permanently in Ruby On Fri, Apr 26, 2013 at 7:11 AM, cynic limbu wrote: > Can you create a program in ruby that can store a string or delete and > replace them permanently? > > Yes I know you can store and change a string that is stored in a > variable by writing > > var1 = "Hello world" > puts "The string of var1 is #{var1}, To change var1's string type in > anything" > var1 = gets.chomp > print "The string has been changed successfully, The string now is > #{var1}" > > > But whenever you restart the program again the var1's value changes back > to Hello world. How can you change or the var1's value or remove it > permanently? By permanently, do you mean after the program finishes running? What you are looking for is called "backing store", such as file systems, databases and the like were intended for: to enable the persistence of data across program/script execution. Deciding what type of backing store to use depends on the program's needs, the possibilities are many. If you are just starting out in this, I guess I'd recommend first learning how to read and write to a file.