2012-11-06 21 views

答えて

171

stringsパッケージには、HasPrefixHasSuffixが含まれています。

import "strings" 

startsWith := strings.HasPrefix("prefix", "pre") // true 
endsWith := strings.HasSuffix("suffix", "fix") // true 

play.golang.org

関連する問題