in reply to
Check a string for consecutive digits
Of course,
($digits$i - 1 == $digits$i + 1)
should be
($digits[$i] - 1 == $digits[$i + 1])
. They give you that preview button for a reason, don't they?
Comment on
Re: Check a string for consecutive digits
Select
or
Download
Code
In Section
Seekers of Perl Wisdom