Ok......how do i even begin to explain this.............well it all begin this morning when i saw a UFO.....
I have a sockets application (which is irrelevant), given the code below, which a portion of this:
public static string checkData(string data)
{
// hack - reset data
if (data.Substring(0, data.Length - 2) == "resetdata") option10();
// parse the string and check for the AgentID
string tmp = data.Substring((data.Index
Of("=")+1)
);
string [] strArray = tmp.Split((char)4);
string agentID = strArray[0];
// Before we handle the data, let's first check if we're setting up a new passport
// this is decided by the string: data=tempcode(char(4))code
// so agentID will infact equal tempcode
if (agentID == "tempcode")
{
string moo = strArray[1].ToString();
string baa = moo.Substring(0,moo.Length
-2);
return Authenticate.setupNewPassp
ort(moo,co
nnStr);
}
data variable = "data=tempcode(char4)blah(
char 3)" (obviously char 4 and 3 are replaced with actual char 3 and 4)
Everything is absolutely find all the way up to if (agentID == "tempcode")
it drops down onto string moo = ...etc that evaluates to "blah(char3)" which is absolutely correct.
Now i need to strip of the character at the end of the string............. you would THINK that string baa line would do that....
It litterally just skips over that line and when i try an intrerrogate it in the command window it says it's out of scope!!!
I just don't understand, whatever i try (and that's everything) i can't seem to stip off the end char !!!!
Help......pleease
Start Free Trial