trim the input

This commit is contained in:
Lion 2022-12-05 20:42:31 +08:00
parent b2e33f56af
commit 02173a2e23
1 changed files with 1 additions and 1 deletions

View File

@ -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+"`");
} }