子字符串并返回特定字符后的值 [英] substring and return the value after a specific character
本文介绍了子字符串并返回特定字符后的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Testing.BSMain,文本:起始页"
我想对上面的值进行子串并只返回 vb.net 中 ": " 之后的值.我该怎么做?
I would like to substring the value above and returning me only the value after the ": " in vb.net. How can i do that?
推荐答案
假设没有错误检查:
Dim phrase As String = "Testing.BSMain, Text: Start Page".Split(":")(1)
它只是用冒号分割短语并返回第二部分.
which simply splits the phrase by the colon and returns the second part.
要使用 SubString,试试这个:
To use SubString, try this:
Dim test As String = "Testing.BSMain, Text: Start Page"
Dim phrase As String = test.Substring(test.IndexOf(":"c) + 1)
这篇关于子字符串并返回特定字符后的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文