stringでも"hoge"[0:]
みたいな記法ができて便利
(他にいい方法があるかもしれない)
package main
import "strings"
func main(){
filename := "hoge.piyo.moge.js"
pos := strings.LastIndex(filename, ".")
println(filename[pos:]) // .js
}
Go to list of users who liked
More than 5 years have passed since last update.
stringでも"hoge"[0:]
みたいな記法ができて便利
(他にいい方法があるかもしれない)
package main
import "strings"
func main(){
filename := "hoge.piyo.moge.js"
pos := strings.LastIndex(filename, ".")
println(filename[pos:]) // .js
}
Register as a new user and use Qiita more conveniently
Go to list of users who liked