如何根据符号分割? [英] how to split based on symbol?

查看:246
本文介绍了如何根据符号分割?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

我已经开发了用于xml元素处理的窗口应用程序.现在我的问题是来自标签< headline> toranto;.国家//标题我需要在一个文本框中获取toranto,在另一个文本框中获取National.如何使用;并获取值?

Dear all,

i have developed window application for xml element handling.now my problem was from the tag <headline>toranto; national</headline> i need to get toranto in one textbox and national in another text box.how to split using ; and get the values?

推荐答案

尝试:
Dim s As String = "toranto; national"
Dim parts As String() = s.Split(";"C)


使用如下代码
首先是;
然后子串
Use code like below
first split by ;
and then substring
Dim a = "<headline>toranto; national</headline>"
Dim ary = a.split(";")

txtbox1.text = ary(0).tostring.substring(ary(0).indexof(">"),ary(0).tostring().length - ary(0).indexof("<"))

txtbox2.text = ary(1).tostring.substring(ary(1).indexof("<"),ary(1).tostring().length - ary(0).indexof("<"))


祝您编码愉快!
:)


Happy Coding!
:)


这篇关于如何根据符号分割?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆