置換演算子(PowerShell 入門)

by HIRO 21. 8月 2008 22:37

この記事は以前 http://blog.hiros-dot.net/ に書いたものです。

置換演算子は、指定した値で元の値の一部または全体を置き換えることができます。置換演算子は下記に示すように3つあります。

演算子 説明
-replace 半角英字の大文字/小文字を区別しないで置換する。
-ireplace 半角英字の大文字/小文字を区別しないで置換する。
-creplace 半角英字の大文字/小文字を区別して置換する。

置換演算子は下記のようにして使用します

"置換対象文字列" -replace "置換したい文字(列)", "置換後の文字(列)"

下記は"Hiro"という文字列を"Hero"へ置換します

PS C:\Work> "Hiro" -replace "i","e"

最新のブログ

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

PowerShell | PowerShell入門

コメントを書く


 

  Country flag

biuquoteredbluegreenyellowPowerShellTextFile
  • コメント
  • プレビュー
Loading



Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2009 PowerShell from Japan!!