代表者の戯言

Know the split


I always use this VB technic,split! I want to show this for you and for my bad memory.


For example,there is such data(data name:list)


ID2/nakajima/\3,300/2024-8


ID9/saito/\1,000/2024-7


ID8/hirose/\9,900/2024-9


ID4/hosoi/\600/2024-10


If you want to get the data by row,I recommend you to program like this.


‘-------------------------------------------------------


dim list as string=""


list=list & "ID2/nakajima/\3,300/2024-8"


list=list & "ID9/saito/\1,000/2024-7"


list=list & "ID8/hirose/\9,900/2024-9"


list=list & "ID4/hosoi/\600/2024-10"


‘-----------------------------------------------------


Dim text2 As String


Dim textarray() As String


Dim p as String=””


‘this p means the character which you want to split.you can also alot vbnewline etc.


p=vbnewline


textarray = list.Split(p)


For Each text2 In textarray


'MessageBox.Show(text2, "result")


Next


By doing like this, you can get data by row.(per vbnewline)