good evening everybody
i have a problem in my project, but i dont know where is the error
code:
and the output is :
arrayofplain(0,0) must = a, but it is: AAAAAAAAAAAAAAAAAAA
where is the error ?
help me please
thanks in advance![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
i have a problem in my project, but i dont know where is the error
code:
VB.NET:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox3.Text = ""
Dim cols As Integer = TextBox1.Text
Dim plaintext As String = TextBox2.Text
Dim plainarray As Array = plaintext.ToCharArray()
Dim textarraylength As Integer = plainarray.Length
TextBox3.Text = Ceiling(textarraylength / cols)
arrayOfPlain = New String(Ceiling(textarraylength / cols), cols) {}
For i As Integer = 0 To arrayOfPlain.GetUpperBound(0)
For j As Integer = 0 To arrayOfPlain.GetUpperBound(1)
arrayOfPlain(i, j) = "A"
Next
Next
arrayOfPlain(0, 0) = ""
'****************
For i As Integer = 0 To arrayOfPlain.GetUpperBound(0)
For j As Integer = 0 To arrayOfPlain.GetUpperBound(1)
TextBox4.Text += arrayOfPlain(i, j)
Next
Next
'****************
For i As Integer = 0 To arrayOfPlain.GetUpperBound(0)
For j As Integer = 0 To arrayOfPlain.GetUpperBound(1)
TextBox4.Text += arrayOfPlain(i, j) + " "
Next
TextBox4.Text += vbCrLf
Next
End Sub
and the output is :
VB.NET:
textbox1:3
textbox2:abcdefghijk
textbox3:4
textbox4:AAAAAAAAAAAAAAAAAAA A A A
A A A A
A A A A
A A A A
A A A A
arrayofplain(0,0) must = a, but it is: AAAAAAAAAAAAAAAAAAA
where is the error ?
help me please
thanks in advance