VS 2015,c#。 我有一根绳子...
string str = "Name;IPAddress";
我只想提取 IP 地址。 我怀疑正则表达式是最好的方法,但我不确定。
非常感谢任何帮助。
最佳答案
您可以使用Split
string str = "Name;IPAddress";
string[] both = str.Split(';');
string name = both[0];
string ipadd = both[1];
关于c# - C#中如何从字符串中提取字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35076508/