How to solve "doesn't return value on all codepath" error

Posted On // Leave a Comment
 
Function XorString(ByVal targetString As String, ByVal maskValue As String) As String
    Dim Index As Integer = 0
    Dim ReturnValue As String = ""
    For Each CharValue As Char In targetString.ToCharArray
        ReturnValue = String.Concat(ReturnValue, Chr(Asc(CharValue) Xor Asc(maskValue.Substring(Index, 1))))
        Index = (Index + 1) Mod maskValue.Length
    Next
    Return ReturnValue
End Function
 
sumber : http://vbnotebookfor.net
 

0 komentar: