diff --git a/notes/剑指 offer 题解.md b/notes/剑指 offer 题解.md index 5e2b2553..8593f936 100644 --- a/notes/剑指 offer 题解.md +++ b/notes/剑指 offer 题解.md @@ -1017,6 +1017,7 @@ public boolean match(char[] str, char[] pattern) { ```java public boolean isNumeric(char[] str) { + if(str.length==0||str==null) return false; return new String(str).matches("[+-]?\\d*(\\.\\d+)?([eE][+-]?\\d+)?"); } ```