Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
let s = n.toString(b);
String s = Integer.toString(n, b);
sub int_to_base_str {
my ($n, $b) = @_;
my $digits = '0123456789abcdefghijklmnopqrstuvwxyz';
my ($s, $q, $remainder) = ('');
return '0' if $n == 0;
use integer;
while ($n) {
($n, $remainder) = ($n / $b, $n % $b),
$s = substr($digits, $remainder, 1) . $s;
}
return $s
}
def int_to_base_str(n, b):
digits = '0123456789abcdefghijklmnopqrstuvwxyz'
s = ''
if n == 0: return '0'
while n:
n, remainder = divmod(n, b)
s = digits[remainder] + s
return s
s = n.to_s(b)