mirror of
https://gitee.com/johng/gf.git
synced 2024-11-29 18:57:44 +08:00
Merge pull request #1651 from chenzebinm4/develop/bert
Repeat 'len(s)'.
This commit is contained in:
commit
5ee297d999
@ -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