Sorry but it's quite unclear what really do you want to do ....
Can you restate your problem with more details?
I really am very sorry .. just want to help ...
The array cannot be "indefinite." It needs to be declared by a size. Then you can use a For-Next loop to modify the contents of each array element. For example, the following code will concatenate the index number before the rest of the text in each array element:
Dim hi(99) As String
For x As Integer = 0 To 99
hi(x) = x.ToString & hi(x)
Next
I have to agree with Daniel. You really haven't provided enough information for us to provide you with a solution that isn't just a guess. Please provide a full and clear indication of what you're trying to achieve, not just in the context of the code but also within the context of the application. What functionality is this supposed to implement? If we understand the what and the why, then we can provide the how.
Dim myList As New List(Of String)
myList.AddRange(Me.TextBox1.Lines)
For i As Integer = 0 To myList.Count - 1
myList.Item(i) = myList.Item(i).Replace("*", i + 1)
Next
Me.TextBox1.Text = String.Join(Environment.NewLine, myList.ToArray)
I'd prefer to trim off the first char with string.Substring(1) and prepend the counter. Replace may affect other parts of the string. I'd also use a stringbuilder
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.