Created
October 14, 2013 09:08
-
-
Save aeg/6973014 to your computer and use it in GitHub Desktop.
0埋めの文字列として出力する
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def str="1" | |
// Case #1 | |
// 0埋めの文字列として出力する | |
assert "001"==str.padLeft(3, "0") | |
// Case #2 | |
// 空白文字で左埋めするには(埋める文字列を指定しないと空白になる) | |
assert " 1"==str.padLeft(3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment