Is there a method in Ruby that does the opposite String#succ
?
If you run succ
or next
you get this:
a = "4.4.10"
a.succ
=> "4.4.11"
I want the opposite:
a = "4.4.10"
a.previous
=> "4.4.09"
Is this possible? I was having a hard time finding this in the Ruby docs. Maybe it doesn't exist?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…