trim the input

This commit is contained in:
Lion
2022-12-05 20:42:31 +08:00
parent e085caf148
commit 2c46a386cc

View File

@@ -17,7 +17,7 @@ public class Segment {
// parser the Segment from an input string
public static Segment parse(String input) throws Exception {
String[] ps = input.split("\\|", 3);
String[] ps = input.trim().split("\\|", 3);
if (ps.length != 3) {
throw new Exception("invalid ip segment `"+input+"`");
}