[转]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
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
相关文章推荐
- [Ubuntu] 如何在VirtualBox OSE中使用share folders -- How to use the share folders in VirtualBox OSE
- How to use ComboBox Control in VC++ - 在VC中如何使用 ComboBox 控件
- 如何使用th:each属性迭代模板-原标题:How To Use th:each For Iteration In Thymeleaf Template?
- 在iPhone应用中如何使用随机数(How to Use Random Numbers in Your iPhone App)
- Android:How to use loader in Android(如何使用Loader)
- 如何在C++中使用VBScript(使用Qt)--How to use VBScript in C++ (Using Qt)
- 如何在QT for S60 中使用pthread库(Carbide.c++) (How to use pthread in QT4.6 for S60)
- All-In-One Code Framework(AIO): 如何编写VC++代码来使用COM组件 (How to use COM in a VC++ client)
- How to use logrotate to manage log files in linux(如何在Linux中使用logrotate去管理日志文件)
- How to use toolbar control on dialog using CToolBar class in VC++ - VC++ 中用CToolBar 类如何使用ToolBar控件
- HowTo use linux laptop in presentations 【如何在Linux系统上使用投影仪】
- 如何在Vista中使用MMC方式的Remote Desktops(How to use Remote Desktops through mmc console in Vista)
- 如何在python中使用*args,**kwargs (How to use *args and **kwargs in Python)
- How to use bitBucket with EGit in Eclipse,如何在Eclipse中使用bitbucket远程仓库
- 如何在MMIT上使用WMLScript文件(How To Use WMLScript Files With MMIT)
- How to use the windows active directory to authenticate user via logon form 如何自定义权限系统,使用 active directory验证用户登录
- 如何使用ODB(How to use odb On windows)
- (译)如何使用SocketAsyncEventArgs类(How to use the SocketAsyncEventArgs class)
- 译文:如何使用SocketAsyncEventArgs类(How to use the SocketAsyncEventArgs class) (转)
- How to use expdp/empdp in Oracle Database (使用expdp/impdp导入导出oracle数据 )