format method

String format(
  1. List<Object> arg
)

Replaces String with the C printf format.

Pass the object to be replaced to arg.

Please list the letters to be replaced in the format below.

StringをC言語のprintfの書式で置き換え返します。

argに置き換えるオブジェクトを渡します。

下記のフォーマットで置き換える文字を記載してください。

  • %s Outputs a string. 文字列を出力する。 %8s, %-10s
  • %d Output an integer in decimal. 整数を10進で出力する。 %-2d, %03d
  • %o Output an integer in octal. 整数を8進で出力する。 %06o, %03o
  • %x Output an integer in hexadecimal. 整数を16進で出力する。 %04x
  • %f Output real numbers. 実数を出力する。 %5.2f

Implementation

String format(List<Object> arg) {
  return sprintf(this, arg);
}