问题
How do I check if a string is a substring of another string in Go?
For example, I want to check someString.contains("something")
.
回答1:
Use the function Contains
from the strings
package.
import {
"strings"
}
strings.Contains("something", "some") // true
来源:https://stackoverflow.com/questions/45266784/go-test-string-contains-substring