- 赞助 BTC: 1Cbd6oGAUUyBi7X7MaR4np4nTmQZXVgkCW
- 赞助 ETH: 0x623A3C3a72186A6336C79b18Ac1eD36e1c71A8a6
- Go语言付费QQ群: 1055927514
- https://godoc.org/github.com/chai2010/spacestring
- spacestring contains more than 1 space characters
- empty string is not spacestring
^\s+$
is space string
package main
import (
"fmt"
"github.com/chai2010/spacestring"
)
func main() {
// space string contains more than 1 space characters
fmt.Println(spacestring.IsSpace(" "))
fmt.Println(spacestring.IsSpace(" \t\n\r"))
// empty string is not space string
fmt.Println(spacestring.IsSpace(""))
// non space string is not space string
fmt.Println(spacestring.IsSpace(" abc "))
// Output:
// true
// true
// false
// false
}
Report bugs to chaishushan@gmail.com.
Thanks!