将字符串转换为列表(字符串) [英] Convert string to list(of string )

查看:138
本文介绍了将字符串转换为列表(字符串)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将字符串转换为列表(字符串)



代码:

  Dim 名称正如列表(>  字符串)= DB.GetNames(firstname).ToString()? 





我尝试 tolist(字符串) <给我错误br />


你能帮我这个吗?

解决方案

试试:

< pre lang =vb> Dim name As New 列表( 字符串
name.Add(DB.GetNames(firstname) )






这里有几种方法。



1) - 声明你的清单......然后填充:

  Dim  name  As 列表(  字符串)= 列表(  字符串
name.Add(test())





2)在声明时填充:

  Dim  name  As  List(  字符串)= 列表( Of   String )({DB.GetNames(firstname)()})





...希望它有所帮助。


How to convert string to List(Of String)?

Code:

Dim name As List(Of String) = DB.GetNames(firstname).ToString() ?



It is giving me error when i try tolist(of string)

Can you help me with this?

解决方案

Try:

Dim name As New List(Of String)
name.Add(DB.GetNames(firstname))


Hi,

Here is a couple of ways.

1) - Declaring your list ... and then populating:

Dim name As List(Of String) = New List(Of String)
name.Add(test())



2) Populating when declaring:

Dim name As List(Of String) = New List(Of String)({DB.GetNames(firstname)()})



... hope it helps.


这篇关于将字符串转换为列表(字符串)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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