Quantcast
Channel: OKWAVE 閲覧数の多い質問(Java/253)【本日】
Viewing all articles
Browse latest Browse all 68675

Javaで文字列をゼロ埋め(ゼロパディング)

$
0
0
Javaで文字列を前ゼロで埋め(ゼロパディング)たいのですが、 exceptionが発生してうまくいきません。 だれかお助け頂けたら助かります。 (例)123の前に0を5つ結合したい場合、 String str2="123"; String str = String.format("%08s",str2); で問題無いと思ったのですが、 exceptionが発生してしまいます。 回答お待ちしております。

Viewing all articles
Browse latest Browse all 68675

Trending Articles