2014-02-21 55 views
-4
dim a as string = "select id from table" 

我想要的,例如,第二段爲這樣:提取款號

second paragraph = "ID" 
There paragraph = "from" 

......

回答

0

基於空間在VB分割字符串:

Dim words As String() = MyString.Split() 

在C#:

string[] Parts = MyString.Split(new char[0]); 

string[] Parts = MyString.Split(null); 
+1

沒有必要使用分方法時,指定空間炭,而不parametters拆分使用空間炭作爲缺省定界符,則該返回相同的結果:'昏暗詞語作爲字符串( )= MyString.Split()' – ElektroStudios