Multiline text box manipulating
-
I am making a little app and I am stuck. I have a multilined textbox and I would like a button to take the text and reverse the line order. So if the text was numbered each line as 1->9, pressing the button will reorder the lines so they are 9->1.
-
I am making a little app and I am stuck. I have a multilined textbox and I would like a button to take the text and reverse the line order. So if the text was numbered each line as 1->9, pressing the button will reorder the lines so they are 9->1.
-
Member 11096018 wrote:
I am making a little app and I am stuck.
Where are you stuck? Edit your message and show exactly which part you are having problems with.
i figured it out Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click Dim counter As Integer = txtNames.Lines.Length - 1 ' create array to reverse line order ReDim fileNames(counter) For iLine = 0 To counter fileNames(counter) = txtNames.Lines(iLine) Next iLine ' using the array building a string starting from the end of the array Dim list As String = "" For iLine = 0 To counter list = list + txtNames.Lines(counter) + vbCrLf counter = counter - 1 Next iLine 'display results txtNames.Text = list.Trim End Sub
-
I am making a little app and I am stuck. I have a multilined textbox and I would like a button to take the text and reverse the line order. So if the text was numbered each line as 1->9, pressing the button will reorder the lines so they are 9->1.
To play and increase your level must CLICK on http://techgurulab.com/course/vb-net-quiz-online/[^]