You might be able to do something like (I'd normally use something like this for reading from a file, but it seems to work here too):
string ReadWord(string buffer, char delimiter, int startPos)<br />{<br /> StringBuilder sb = new StringBuilder();<br /> for(int i=startPos; i<buffer.Length; i++)<br /> {<br /> if(buffer[i] == delimiter)<br /> break;<br /><br /> sb.append(buffer[i]);<br /> }<br /><br /> return sb.toString();<br />}<br /><br />void main()<br />{<br /> string firstPart = ReadWord(fullLine, ' ', 0);<br /> int startPos = fullLine.IndexOf('[');<br /> string secondPart = ReadWord(fullLine, ']', startPos);<br />}
Thats just from memory so it may not compile, but you get the idea.