Merge branch 'master' of https://github.com/CyC2018/InterviewNotes
This commit is contained in:
commit
801985368f
|
@ -1017,8 +1017,12 @@ public boolean match(char[] str, char[] pattern) {
|
||||||
|
|
||||||
```java
|
```java
|
||||||
public boolean isNumeric(char[] str) {
|
public boolean isNumeric(char[] str) {
|
||||||
|
<<<<<<< HEAD
|
||||||
if (str == null)
|
if (str == null)
|
||||||
return false;
|
return false;
|
||||||
|
=======
|
||||||
|
if(str.length==0||str==null) return false;
|
||||||
|
>>>>>>> 641325422fdf746c627924e530d56949740c0e18
|
||||||
return new String(str).matches("[+-]?\\d*(\\.\\d+)?([eE][+-]?\\d+)?");
|
return new String(str).matches("[+-]?\\d*(\\.\\d+)?([eE][+-]?\\d+)?");
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue
Block a user