hi!
ahwell this was going good, I thought i figured it out. A replica of http://www.dupecop.com/images/desktop-screenshot-large.gif
But after a little testing it's obvious mine si 100% not working right
Here's the code:
even when new string and original string are exactly the same, im still being told they are different. huh ?
ahwell this was going good, I thought i figured it out. A replica of http://www.dupecop.com/images/desktop-screenshot-large.gif
But after a little testing it's obvious mine si 100% not working right
Here's the code:
VB.NET:
Private Sub btn_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn.Click
Dim Ntxt As String = "my name is sean and this is my old text" 'the new text
Dim Otxt As String = "my name is sean and this is my old text" 'the original
Dim Anew() As String
Dim Aold() As String
Dim rate As Integer = 0%
Dim percent As Integer = 100%
Dim result As String
Anew = Split(Ntxt, " ")
Aold = Split(Otxt, " ")
' the following comparing routine is the best but worst i could think of
For i = 1 To UBound(Anew)
If Anew(i) = Nothing Then GoTo done
For x = 1 To UBound(Aold)
If Not Anew(i) Like Aold(x) Then
rate += 1%
End If
Next
Next
done:
If Len(percent / rate) > 4 Then
result = Mid((percent / rate), 1, 4)
Else
result = (percent / rate)
End If
If result < 20% Then
MsgBox("your new input is now " & result & "% like the original, good job!")
Else
MsgBox("your new input is now " & result & "% like the original, I suggest you work a little harder.")
End If
End Sub
even when new string and original string are exactly the same, im still being told they are different. huh ?