Anonymous user
Increment a numerical string: Difference between revisions
no edit summary
(plainTeX) |
No edit summary |
||
Line 4:
=={{header|Ada}}==
The standard Ada package Ada.Strings.Fixed provides a function for trimming blanks from a string.
<lang ada>
S : String := "12345";
S := Ada.Strings.Fixed.Trim(Source => Integer'Image(Integer'Value(S) + 1), Side => Ada.Strings.Both);
</
=={{header|BASIC}}==
Line 169:
<!-- ((show :: Integer -> String) . succ . read) "1234"
At least one type signature somewhere in the code is necessary, because otherwise there is no specification of what kind of value should be incremented; the operation is equally applicable to any instance of <
((show :: Bool -> String) . succ . read) "False" -->
|