]> gitweb.factorcode.org Git - factor.git/blob - extra/successor/successor-docs.factor
fad0a23d11fb9c5dafa6b2b5ff88f5008eb054e3
[factor.git] / extra / successor / successor-docs.factor
1 ! Copyright (C) 2011 John Benediktsson.
2 ! See http://factorcode.org/license.txt for BSD license.
3
4 USING: help.markup help.syntax successor strings ;
5
6 IN: succesor
7
8 HELP: successor
9 { $values { "str" string } }
10 { $description
11     "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. "
12     $nl
13     "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. "
14 } ;
15
16