واسه سوال دوم از منوی projecy گزینه add module رو بزن و این کد رو بزار توی اون:
<System.Runtime.CompilerServices.Extension()> _
Public Sub RemoveAt(Of T)(ByRef arr As T(), ByVal index As Integer)
Dim uBound = arr.GetUpperBound(0)
Dim lBound = arr.GetLowerBound(0)
Dim arrLen = uBound - lBound
If index < lBound OrElse index > uBound Then
Throw New ArgumentOutOfRangeException( _
String.Format("Index must be from {0} to {1}.", lBound, uBound))
Else
'create an array 1 element less than the input array
Dim outArr(arrLen - 1) As T
'copy the first part of the input array
Array.Copy(arr, 0, outArr, 0, index)
'then copy the second part of the input array
Array.Copy(arr, index + 1, outArr, index, uBound - index)
arr = outArr
End If
End Sub
حالا توی رویداد مورد نظرت این کد رو بزار:
Dim RESULT As String = ""
Dim STR As String = " aalli rezar "
Dim list(STR.Length) As Byte
Dim i As Integer = 0
For Each ch As Char In STR
list(i) = Asc(ch)
i += 1
Next
Dim k, j As Integer
j = 0
While j < list.Length
k = j + 1
While k < list.Length
If list(j) = list(k) Then
list.RemoveAt(k)
End If
k += 1
End While
j += 1
End While
For Each num As Byte In list
RESULT += Chr(num)
Next
MsgBox(RESULT)
جاییشو نفهمیدی بگو توضیح بدم