Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
数字があります。数字が 9 桁未満の場合は、この数字の先頭にゼロを埋め込みたいと思います。
現在、番号がある場合は、次のように言いましょう:
val num = "123"
使えばpadTo(9,"0")手に入る"123000000"けど欲しい"000000123"…
padTo(9,"0")
"123000000"
"000000123"
これに対する最善の解決策は何ですか?
scalaでソリューションを取得する方が良いでしょう
ありがとう