Simple Sand Samples |
説明のないとってもシンプルなサンプルプログラム集
COBOL | awk | C言語 | D言語 | GO言語 | Lua | Vim |
bash | Perl | Gauche | Clojure | CLISP | EmacsLisp | VimScript |
tcsh | Ruby | Groovy | Java | C# | VBScript | JavaScript |
Io言語 | Python | Erlang | Scala | VB.NET | Excel/VBA | PHP |
Tcl | Haskell | OCaml | PowerShell | Windows | Unix/Linux |
PowerShell > 書式付きプリント
printf.ps1
|
|
Windows PowerShell
Copyright (C) 2014 Microsoft Corporation. All rights reserved.
PS C:\Users\takk> "{0:d5}" -f 123
00123
PS C:\Users\takk> "{0,-8}" -f 123
123
PS C:\Users\takk> "{0,8}" -f 123
123
PS C:\Users\takk> "{0:.##0}" -f 123.45
123.450
PS C:\Users\takk> "{0,7} / {1:d5}" -f 12.34, 56
12.34 / 00056
PS C:\Users\takk> "{0} {1}" -f "123.45", "12"
123.45 12
PS C:\Users\takk>
Copyright (C) 2014 Microsoft Corporation. All rights reserved.
PS C:\Users\takk> "{0:d5}" -f 123
00123
PS C:\Users\takk> "{0,-8}" -f 123
123
PS C:\Users\takk> "{0,8}" -f 123
123
PS C:\Users\takk> "{0:.##0}" -f 123.45
123.450
PS C:\Users\takk> "{0,7} / {1:d5}" -f 12.34, 56
12.34 / 00056
PS C:\Users\takk> "{0} {1}" -f "123.45", "12"
123.45 12
PS C:\Users\takk>