[Solved] How can I separate a single String into two parts? [duplicate]


You used to have

str.split(",");

and split() is a void method. It doesn’t alter str.

you could fix it by replacing str.split(",") with: str = str.split(","), or you could put it all on one line like:

while ((str = br1.readLine()) != null)
    userstr.add(str.split(",")[0]);

2

solved How can I separate a single String into two parts? [duplicate]