Added new function in common.

This commit is contained in:
Ryan O'Hara-Reid
2018-02-15 11:12:55 +11:00
committed by Adrian Gallagher
parent cd398bd35f
commit fa041104b2
2 changed files with 30 additions and 0 deletions

View File

@@ -155,6 +155,17 @@ func StringDataCompare(haystack []string, needle string) bool {
return false
}
// StringDataContainsUpper checks the substring array with an input and returns
// a bool irrespective of lower or upper case strings
func StringDataContainsUpper(haystack []string, needle string) bool {
for _, data := range haystack {
if strings.Contains(StringToUpper(data), StringToUpper(needle)) {
return true
}
}
return false
}
// JoinStrings joins an array together with the required separator and returns
// it as a string
func JoinStrings(input []string, separator string) string {