$fileName = "example_file_name.txt"
# ファイル名を"_"で分割
$fileParts = $fileName -split '_'
# 最初の配列を削除
$fileParts = $fileParts[1..($fileParts.Count - 1)]
# 拡張子を削除
$fileParts[-1] = $fileParts[-1] -replace "\.[^.]+$", ""
# 必要な部分を取得
$result = $fileParts -join "_"
# 結果を表示
Write-Output $result
More than 1 year has passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme