本人新学的vb.net,想指教大家一个问题。假设输入一串字符串长度为20字节,第一字节和第二字节异或的结果再与第三字节异或,以此类推,最后保存异或完的那个字节,怎么编写代码呢?我在网上找了类似的代码修改还是不得,求各位大神指教,求附上代码,谢谢。
------解决思路----------------------
Public Class Class2
Sub MySub()
Dim Char1 As Char() = "abcdeeda"
Dim First1 As Char = Char1.First
Dim Value1 As Char
Dim Index1 As Integer
Dim Result1 As Char()
Dim Boolean1 As Boolean = True
Do
Index1 += 1
Value1 = Char1.ElementAt(Index1)
If First1.Equals(Value1) Then
Result1 = Char1.Take(Index1).ToArray
Boolean1 = False
Else
First1 = Char1.ElementAt(Index1)
End If
Loop While Boolean1
End Sub
End Class