trim the input
This commit is contained in:
parent
b2e33f56af
commit
02173a2e23
|
|
@ -17,7 +17,7 @@ public class Segment {
|
||||||
|
|
||||||
// parser the Segment from an input string
|
// parser the Segment from an input string
|
||||||
public static Segment parse(String input) throws Exception {
|
public static Segment parse(String input) throws Exception {
|
||||||
String[] ps = input.split("\\|", 3);
|
String[] ps = input.trim().split("\\|", 3);
|
||||||
if (ps.length != 3) {
|
if (ps.length != 3) {
|
||||||
throw new Exception("invalid ip segment `"+input+"`");
|
throw new Exception("invalid ip segment `"+input+"`");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue