mirror of
https://github.com/CyC2018/CS-Notes.git
synced 2025-07-10 13:37:35 +08:00
auto commit
This commit is contained in:
@ -1017,6 +1017,8 @@ public boolean match(char[] str, char[] pattern) {
|
|||||||
|
|
||||||
```java
|
```java
|
||||||
public boolean isNumeric(char[] str) {
|
public boolean isNumeric(char[] str) {
|
||||||
|
if (str == null)
|
||||||
|
return false;
|
||||||
return new String(str).matches("[+-]?\\d*(\\.\\d+)?([eE][+-]?\\d+)?");
|
return new String(str).matches("[+-]?\\d*(\\.\\d+)?([eE][+-]?\\d+)?");
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
Reference in New Issue
Block a user