Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15499

Splitting a large string while adding it to a listview?

$
0
0
Hello, I am looking for guidance on how to Split up this large string, while also adding it to my listview.

*@FIRST&%SECOND#!THIRD$*@FIRST&%SECOND#!THIRD$*@FIRST&%SECOND#!THIRD$*@FIRST&%SECOND#!THIRD$*@FIRST& %SECOND#!THIRD$*@FIRST&%SECOND#!THIRD$*@FIRST&%SECOND#!THIRD$*@FIRST&%SECOND#!THIRD$*@FIRST&%SECOND# !THIRD$*@FIRST&%SECOND#!THIRD$*@FIRST&%SECOND#!THIRD$

At the moment, I am only able to add the first set into my listview.
I have a feeling I need a loop, as well as remove part of the string once it has been added to the listview, but I am quite new to VB and have tried and tried, though unsuccessful. :confused:
If you are someone who could help resolve this for me id be really greatfull for your help.

Code:

Dim stringdata as string = "*@FIRST&%SECOND#!THIRD$*@FIRST&%SECOND#!THIRD$*@FIRST&%SECOND#!THIRD$*@FIRST&%SECOND#!THIRD$*@FIRST&%SECOND#!THIRD$*@FIRST&%SECOND#!THIRD$*@FIRST&%SECOND#!THIRD$*@FIRST&%SECOND#!THIRD$*@FIRST&%SECOND#!THIRD$*@FIRST&%SECOND#!THIRD$*@FIRST&%SECOND#!THIRD$"

Dim id As Integer = stringdata.IndexOf("@")
Dim fd As String = stringdata.Substring(id + 1, stringdata.IndexOf("&", id + 1) - id - 1)
Dim id As Integer = stringdata.IndexOf("%")
Dim fd As String = stringdata.Substring(id + 1, stringdata.IndexOf("#", id + 1) - id - 1)
Dim id As Integer = stringdata.IndexOf("!")
Dim fd As String = stringdata.Substring(id + 1, stringdata.IndexOf("$", id + 1) - id - 1)

LVProc.Items.Add(New ListViewItem({fdsa, fdsb, fdsc}))


Viewing all articles
Browse latest Browse all 15499

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>