Function f(ByVal x As String, ByVal y As Integer, ByVal z As Integer, ByVal w As Integer, ByRef t As String) As String
If Length(x) < w Then // Definition for Length below
Return t
End If
If y = z Then
t = t + SubStr(x, w, 1) // Definition for SubStr below
z = 1
Else
z = z + 1
End If
w = w + 1
Return f(x, y, z, w, t)
End Function
Function f1(ByVal x As String, ByVal y As Integer) As String
Return (f(x, y, 1, 1, ""))
End Function
I am not a VB programmer, but I assumed for the most part that the syntax is C like, I received the program above from a non-technical recruiter with the following input f1(“enritcde3 dtyeds4t8”, 2) . From my understanding the following output would be (“enritcde3 dtyeds4t8”,2,2,2,“”)
. Am I missing something???
Just converted it over to Vb.Net and the output is “nice test”.
Its parsing the even position characters in the string excluding the space.