i'm interested in creating a client/server application in which server stores the names and phone numbers of 10 persons and when client sends a name, the server looks up in the array. If the name send by the client is present in the array, it sends the corresponding phone no to the client.....
The code goes something like this:
However the problem that im facing is that the function indexOF() returns -1 even if the name typed by the client is present in the array.
if s1 = the string which takes data of array present at evry index = pda123
and s = name send by client = pda
s1.indexOf(s) returns -1
However when i manually took two strings of same name pda123 and pda and applied the same function, then it returns 0 as expected.
I can't understand how is it even possible....
It is blowing up my mind. Please help urgently.....