Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2008 [RESOLVED] Reading

$
0
0
Hi all , I've been working with huges string lately and I've noticed something. I want to store around 9 chars into an array. Then create skip to next array and store 9 more chars but the string lenght is random, so If the last string is smaller than 9, it will skip. So I decided to store each chars into arrays, work fine but the function I made work too slow. It return nothing since it doesn't have the time to procced . There is a quick overview of my code :

Code:

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        MsgBox(trimdata(RichTextBox1.Text))

     

    End Sub
    Private Function trimdata(ByVal data As String) As String
        Dim s As String = ""
        Dim array(data.Length - 1) As String
        Dim cnt As Integer = 1
        For Each c As String In data
            If c = Label1.Text Then
                Return s.Replace(Label1.Text, "")
                Exit Function
            End If

            s = s & "array(" & cnt & ") = " & Label1.Text & c & Label1.Text & vbNewLine
            cnt += 1

        Next

        Return s
    End Function
End Class

If someone could lead me to right path , I'd appreciate !! Thanks ! :afrog:

Viewing all articles
Browse latest Browse all 27554

Trending Articles



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