如何在VB.NET中拆分
发布时间:2020-12-17 00:13:37 所属栏目:大数据 来源:网络整理
导读:我正在使用VB.NET代码. 我有以下字符串. http://localhost:3282/ISS/Training/SearchTrainerData.aspx 现在我想用“/”分割上面的字符串.我想将值SearchTrainerData.aspx存储在变量中. 在我的情况下 Dim str as Stringstr = "SearchTrainerData.aspx" 什么是
我正在使用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) (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |