string.next adds a character when it reaches a boundary, or adds a digit or decimal place when appropriate : next « String « Ruby






string.next adds a character when it reaches a boundary, or adds a digit or decimal place when appropriate


puts "z".next
puts "zzzz".next
puts "999.0".next
puts "999".next 

 








Related examples in the same category

1.Call next function from string class
2.Call next function on returning result from reverse
3.string.next is based on the character set in use
4.Chain calls of next together
5.next works for numbers represented as strings
6.number.next
7.next method from Integer.