mirror of
https://gitlab.com/kauron/jstudy
synced 2024-12-22 16:33:33 +01:00
Trim input
This commit is contained in:
parent
10420215d6
commit
b557ec9374
1 changed files with 2 additions and 2 deletions
|
@ -82,8 +82,8 @@ public class TestItem {
|
|||
String line = in.nextLine();
|
||||
if (!line.matches("..*" + separator + "..*")) continue;
|
||||
int index = line.indexOf(separator);
|
||||
String question = line.substring(0, index);
|
||||
String answer = line.substring(index + separator.length());
|
||||
String question = line.substring(0, index).trim();
|
||||
String answer = line.substring(index + separator.length()).trim();
|
||||
index = answer.indexOf(separator);
|
||||
if (index != -1)
|
||||
answer = answer.substring(0, index);
|
||||
|
|
Loading…
Reference in a new issue