Logo

Programming-Idioms

History of Idiom 55 > diff from v82 to v83

Edit summary for version 83 by programming-idioms.org:
Restored version 81

Version 82

2020-02-12, 11:51:17

Version 83

2020-02-12, 20:24:47

Idiom #55 Convert integer to string

Create the string representation s (in radix 10) of integer value i.

Illustration

Idiom #55 Convert integer to string

Create the string representation s (in radix 10) of integer value i.

Illustration
Extra Keywords
int base radix conversion
Extra Keywords
int base radix conversion
Code
my $s = "" . $i;
Code
my $s = "" . $i;
Comments bubble
Perl automatically converts numbers to strings, and strings to numbers, whenever required. This means the concatenation with the empty string is strictly superfluous, it only indicates programmer intent.
Comments bubble
Perl automatically converts numbers to strings, and strings to numbers, whenever required. This means the concatenation with the empty string is strictly superfluous, it only indicates programmer intent.
Doc URL
https:/afdsfdsf.com