Question : vb.net - load data into listview

hello there,
I am using this code bellow and its working perfectly fine to load data from a text file into my listview. if the text file has data like this

firstname1:lastname1
firstname2:lastname2
firstname3:lastname3

it will load it up on the listview like this

firstname1:lastname1:email:address:phone
firstname2:lastname2:email:address:phone
firstname3:lastname3:email:address:phone

and if the text file doesnt have any missing columns then it will load them correctly.. so my questions will be how can I make the code replace phone with this "1800-123-1234" always
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
Public Sub LoadUserInfo(ByVal mPath As String, ByVal LVW As ListView)
        If System.IO.File.Exists(mPath) Then
            Dim strLine As String, tabLine() As String, lItem As ListViewItem, tabReplace() As String = {"", "", "email", "address", "phone"}
            Using sr As New System.IO.StreamReader(mPath)
                While Not sr.EndOfStream
                    strLine = sr.ReadLine
                    If strLine <> "" Then
                        tabLine = strLine.Split(":")
                        lItem = LVW.Items.Add(tabLine(0))
                        For j As Integer = 1 To tabLine.GetUpperBound(0)
                            lItem.SubItems.Add(tabLine(j))
                        Next j
                        For j As Integer = tabLine.Count To 4
                            lItem.SubItems.Add(tabReplace(j))
                        Next j
                    End If
                End While
            End Using
        End If
    End Sub

Answer : vb.net - load data into listview

You could pop it it in at the bottom of your "If" block:

                    If strLine <> "" Then
                        tabLine = strLine.Split(":")
                        lItem = LVW.Items.Add(tabLine(0))

                        For j As Integer = 1 To tabLine.GetUpperBound(0)
                            lItem.SubItems.Add(tabLine(j))
                        Next j

                        For j As Integer = tabLine.Count To 4
                            lItem.SubItems.Add(tabReplace(j))
                        Next j

                        lItem.SubItems(4).Text = "1800-123-1234"
                    End If
Random Solutions  
 
programming4us programming4us