Home Ruby 字符串操作,填满0:rjustfillwithzero
Post
Cancel

Ruby 字符串操作,填满0:rjustfillwithzero

"33".to_s.rjust(5, "0")   # =>   00033

This post is licensed under CC BY 4.0 by the author.