1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

paiza.ioでelixir その309

Last updated at Posted at 2024-08-26

概要

paiza.ioでelixirやってみた。
練習問題、やってみた。

練習問題

ゼロパディング zero padding ゼロ埋め 桁そろえ 桁合わせ

参考にしたページ

サンプルコード

String.pad_leading("55", 4, "0")
|> IO.inspect

String.pad_leading("abc", 5)
|> IO.inspect

String.pad_leading("abc", 4, "12")
|> IO.inspect

String.pad_leading("abc", 6, "12")
|> IO.inspect

String.pad_leading("abc", 5, ["1", "23"])
|> IO.inspect


実行結果

"0055"
"  abc"
"1abc"
"121abc"
"123abc"

成果物

以上。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?