如何在VB.NET中拆分

前端之家收集整理的这篇文章主要介绍了如何在VB.NET中拆分前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用VB.NET代码.

我有以下字符串.

http://localhost:3282/ISS/Training/SearchTrainerData.aspx

现在我想用“/”分割上面的字符串.我想将值SearchTrainerData.aspx存储在变量中.

在我的情况下

Dim str as String

str = "SearchTrainerData.aspx"

什么是将上面的字符串拆分并进一步存储在变量中的代码

Split函数接受字符,VB.NET通过在单字符字符串的末尾附加’c’来表示:
Dim sentence = "http://localhost:3282/ISS/Training/SearchTrainerData.aspx"
Dim words = sentence.Split("/"c)
Dim lastWord = words(words.length - 1)
原文链接:https://www.f2er.com/vb/255571.html

猜你在找的VB相关文章