Skip to content
Snippets Groups Projects
Commit ecd2c151 authored by Martin Dolmen Helmersen's avatar Martin Dolmen Helmersen
Browse files

Fix regex issue

parent 0cc8ff03
No related branches found
No related tags found
No related merge requests found
Pipeline #114669 passed
...@@ -45,7 +45,7 @@ public int calculate(String expression) { ...@@ -45,7 +45,7 @@ public int calculate(String expression) {
} }
public int multiplication(String equation) { public int multiplication(String equation) {
String[] split = equation.split("*"); String[] split = equation.split("[*]");
int number1 = Integer.parseInt(split[0]); int number1 = Integer.parseInt(split[0]);
int number2 = Integer.parseInt(split[1]); int number2 = Integer.parseInt(split[1]);
...@@ -54,7 +54,7 @@ public int calculate(String expression) { ...@@ -54,7 +54,7 @@ public int calculate(String expression) {
} }
public int division(String equation) { public int division(String equation) {
String[] split = equation.split("/"); String[] split = equation.split("[/]");
int number1 = Integer.parseInt(split[0]); int number1 = Integer.parseInt(split[0]);
int number2 = Integer.parseInt(split[1]); int number2 = Integer.parseInt(split[1]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment