mirror of
https://github.com/ArvinLovegood/go-stock.git
synced 2025-07-19 00:00:09 +08:00
- 新增 CrawlerApi 结构体和相关方法,实现通用的爬虫功能 - 优化了 openai_api 和 stock_data_api 中的爬虫逻辑 - 添加了 RemoveAllBlankChar函数,用于移除字符串中的空白字符 - 更新了前端 stock组件中的警告提示
18 lines
428 B
Go
18 lines
428 B
Go
package data
|
|
|
|
import "regexp"
|
|
|
|
// @Author spark
|
|
// @Date 2025/2/13 13:08
|
|
// @Desc
|
|
//-----------------------------------------------------------------------------------
|
|
|
|
// RemoveAllBlankChar 使用正则表达式移除字符串中的空白字符
|
|
func RemoveAllBlankChar(s string) string {
|
|
return removeAllSpaces(s)
|
|
}
|
|
func removeAllSpaces(s string) string {
|
|
re := regexp.MustCompile(`\s`)
|
|
return re.ReplaceAllString(s, "")
|
|
}
|