stringsstrings.Contains(strings.ToLower(stringA), strings.ToLower(stringB)

2017-06-16 sreya

+1

With strings - no,but may use stringB as a regex pattern? –

+2

不,但一如果您需要多次键入它,您可以将它放入自己的功能中。 –

+0

[在golang中忽略大小写的字符串搜索]可能的重复(https://stackoverflow.com/questions/24836044/case-insensitive-string-search-in-golang) –