logo
  • 教程列表
  • SO官方文檔
  • 字串
    • 建立基本字串
    • 格式字串
    • 多行字串
    • 這裡字串
    • 連線字串
    • 特殊字元
  1. StackOverflow 文件
  2. PowerShell 教程
  3. 字串
  4. 格式字串

格式字串

Created: November-22, 2018

$hash = @{ city = 'Berlin' }

$result = 'You should really visit {0}' -f $hash.city
Write-Host $result #prints "You should really visit Berlin"

格式字串可以與 -f 運算子或靜態 [String]::Format(string format, args) .NET 方法一起使用。

  • 多行字串
  • 建立基本字串

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明