您的位置:首页 > 运维架构 > Shell

[转]How to use String.Format in PowerShell?(如何在PowerShell中使用string.format?)

2011-12-05 10:26 801 查看
Hah! (We’re back ;-) ) It’s as easy as that:

PS > [string] :: Format( "Hello {0} {1} :-)", "Daniel", "Walzenbach")
Hello Daniel Walzenbach :-)

Needless to say that other formatting – like Currency formatting – works as well

PS > [string] :: Format( "{0:C}", 1234567890)
$1,234,567,890.00

Check out Formatting Types on the .NET Framework Developer's Guide or SteveX Compiled - String Formatting in C#(nice cheat sheet) for more examples.

Cheers!

Daniel
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐