Method: Kernel#printf
- Defined in:
- io.c
permalink #printf(io, string[, obj ... ]) ⇒ nil #printf(string[, obj ... ]) ⇒ nil
Equivalent to:
io.write(sprintf(string, obj, ...))
or
$stdout.write(sprintf(string, obj, ...))
7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 |
# File 'io.c', line 7660
static VALUE
rb_f_printf(int argc, VALUE *argv, VALUE _)
{
VALUE out;
if (argc == 0) return Qnil;
if (RB_TYPE_P(argv[0], T_STRING)) {
out = rb_ractor_stdout();
}
else {
out = argv[0];
argv++;
argc--;
}
rb_io_write(out, rb_f_sprintf(argc, argv));
return Qnil;
}
|