func GetMobilePhoneNumberSegmentRegex() (mobilePhoneNumberSegmentRegex string, er *ulib.Err) {
mobilePhoneNumberSegment, er := GetMobilePhoneNumberSegment()
mobilePhoneNumberSegmentRegex = "^("
for _, v := range mobilePhoneNumberSegment {
if len(mobilePhoneNumberSegmentRegex) > 2 {
mobilePhoneNumberSegmentRegex += "|"
}
mobilePhoneNumberSegmentRegex += string(v.MobileNum)
fmt.Println(string(v.MobileNum))
}
mobilePhoneNumberSegmentRegex += ")\\d{8}"
fmt.Println(mobilePhoneNumberSegmentRegex)
return mobilePhoneNumberSegmentRegex, nil
}
v.MobileNum是int类型
fmt.Println(string(v.MobileNum))打印的是乱码如果使用的是fmt.Println(v.MobileNum)是正常的,折腾了好久不知道问题在哪里
--
--
官网: http://golang-china.org/
IRC: irc.freenode.net #golang-china
@golangchina
---
您收到此邮件是因为您订阅了Google网上论坛上的“Golang-China”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到golang-china...@googlegroups.com。
要在网络上查看此讨论,请访问https://groups.google.com/d/msgid/golang-china/1a3ba9f1-b1ba-4b72-baef-df2945133199o%40googlegroups.com。
谢谢大家,已更改为strconv.itoa()进行处理,o(╯□╰)o犯了一个低级错误
--
--
官网: http://golang-china.org/
IRC: irc.freenode.net #golang-china
@golangchina
---
您收到此邮件是因为您订阅了Google网上论坛上的“Golang-China”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到golang-china...@googlegroups.com。
要在网络上查看此讨论,请访问https://groups.google.com/d/msgid/golang-china/d8a80971-29fc-4b43-b5d8-c1bab9aea824o%40googlegroups.com。