factor/extra/successor/successor-docs.factor

17 lines
786 B
Factor
Raw Permalink Normal View History

2016-04-28 23:51:39 -04:00
! Copyright (C) 2011 John Benediktsson.
! See http://factorcode.org/license.txt for BSD license.
USING: help.markup help.syntax successor strings ;
IN: succesor
HELP: successor
2018-07-07 01:44:46 -04:00
{ $values { "str" string } { "str'" string } }
2016-04-28 23:51:39 -04:00
{ $description
"Returns the successor to " { $snippet "str" } ". The successor is calculated by incrementing characters starting from the rightmost alphanumeric (or the rightmost character if there are no alphanumerics) in the string. Incrementing a digit always results in another digit, and incrementing a letter results in another letter of the same case."
2016-04-28 23:51:39 -04:00
$nl
"If the increment generates a carry, the character to the left of it is incremented. This process repeats until there is no carry, adding an additional character if necessary."
2016-04-28 23:51:39 -04:00
} ;