parsing - Powershell删除第一个特殊字符实例后的文本

标签 parsing powershell

这是我必须解析的值。

8.2.4.151.65; HBAAPI(I) v1.3; 3-29-02

我需要删除;的第一个实例之后(包括第一个实例)的所有内容

所以我需要我的最终结果是8.2.4.151.65

最佳答案

$s = '8.2.4.151.65; HBAAPI(I) v1.3; 3-29-02'
$s.Substring(0, $s.IndexOf(';'))

关于parsing - Powershell删除第一个特殊字符实例后的文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24044226/

相关文章:

xml - Golang : Read single XML document from net.康恩

Lemon 中 token 析构函数的自定义释放函数

java - Java中时间字符串的解析

powershell - 将多个成员添加到Powershell哈希表

python - 使用 Python 和 BeautifulSoup 解析表

c# - 如何在 wpf 的数据网格中获取以编程方式编写的组合框的值?

c# - Powershell Import-Module 命令不适用于 c# api

powershell - 如何更改 PowerShell 的辅助/多行 (>>) 提示符

powershell - 尝试/捕获非法字符

git - 获取 Git 中两次提交之间修改次数最多的文件