- 1). Click "Start," select "Run," then type "cmd" into the Run box to open the command line in Windows. Type "irb" into the command line to open the Ruby debugger.
- 2). Enter this line into the prompt to create a string:
a = "tea" - 3). Replace all instances of the letter "a" with "e" in the string using this line:
a.sub!('a', 'e') - 4). Use this line to see the result:
puts a
SHARE