编辑代码

package main
 
import (
    "fmt"
    "strings"
)
 
func main()  {
    tracer := "https://manhwasmut.com/read-man-up-girl-chapter-66.5.html"
    comma := strings.Index(tracer, "chapter-")
    //comma的意思是从字符串tracer查找第一个逗号,然后返回他的位置,这里的每个中文是占3个字符,从0开始计算,那么逗号的位置就是12
 
    pos := strings.Index(tracer[comma:], ".html")
    //tracer[comma:]这个是的意思截取字符串tracer,从12开始,包括12
 
    fmt.Println(tracer[comma:])

    newstr := tracer[comma:]
    strs := newstr[8:pos]
    //,死神bye bye
 
    //整段的代码的意思是从tracer[comma:]这个字符串中查找“死神”这个字符串,第0位是逗号,第一位开始就是“死神”了,所以这里pos是1
   epid := strings.Replace(strs, ".", "-", -1)  
     
    fmt.Println(comma, pos, epid)
}