Hi I am figuring out how to split the strings so heres my code: because i using bufferedreader and i have two textboxes so it reads both the text boxes (the 1st textbox i type john), the second textbox i type peter) the output is johnpeter so i trying to split the textboxes instead of reading just 1 line straight.
BufferedReader reader = new BufferedReader(new InputStreamReader(
req.getInputStream()));
String name;
while ((name = reader.readLine().toString()) != null)
{
Statement stmt;
String[] players = name.split("");
String playerO = players[1];
String playerX = players[2];
Current output is:
Player 1 :j
Player 2 :o
I would like my output to be:
Player 1 :john
Player 2 :peter
johnpeter
– StephenTG Jul 17 '13 at 18:04