mirror of
https://gitee.com/johng/gf.git
synced 2024-12-03 12:47:50 +08:00
Repeat 'len(s)'.
This commit is contained in:
parent
8f326dcac5
commit
4f95d0a07a
@ -57,13 +57,13 @@ func IsNumeric(s string) bool {
|
||||
if length == 0 {
|
||||
return false
|
||||
}
|
||||
for i := 0; i < len(s); i++ {
|
||||
for i := 0; i < length; i++ {
|
||||
if s[i] == '-' && i == 0 {
|
||||
continue
|
||||
}
|
||||
if s[i] == '.' {
|
||||
dotCount++
|
||||
if i > 0 && i < len(s)-1 {
|
||||
if i > 0 && i < length-1 {
|
||||
continue
|
||||
} else {
|
||||
return false
|
||||
|
Loading…
Reference in New Issue
Block a user