Skip to content
This repository was archived by the owner on Sep 14, 2019. It is now read-only.

Commit 6ea2559

Browse files
committed
use replaceAll instead of for loop
1 parent 1cd4406 commit 6ea2559

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

  • Robot2018/src/org/usfirst/frc/team199/Robot2018/autonomous

Robot2018/src/org/usfirst/frc/team199/Robot2018/autonomous/AutoUtils.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ public static Map<String, ArrayList<String[]>> parseScriptFile(String scriptFile
3636
while (parenIndex != -1) {
3737
// removes all spaces between the parentheses
3838
int endParenIndex = line.indexOf(")", parenIndex);
39-
for (int i = line.indexOf(" ", parenIndex); i < endParenIndex && i != -1; i = line.indexOf(" ", i)) {
40-
line = line.substring(0, i) + line.substring(i + 1);
41-
}
39+
String coord = line.substring(parenIndex + 1, endParenIndex);
40+
line = line.substring(0, parenIndex + 1) + coord.replaceAll(" ", "") + line.substring(endParenIndex);
4241

4342
// finds next parentheses
4443
parenIndex = line.indexOf("(", parenIndex + 1);

0 commit comments

Comments
 (0)