Documentation ¶
Overview ¶
* Copyright (C) 2020-2022 Arm Limited or its affiliates and Contributors. All rights reserved. * SPDX-License-Identifier: Apache-2.0
* Copyright (C) 2020-2022 Arm Limited or its affiliates and Contributors. All rights reserved. * SPDX-License-Identifier: Apache-2.0
* Copyright (C) 2020-2022 Arm Limited or its affiliates and Contributors. All rights reserved. * SPDX-License-Identifier: Apache-2.0
Index ¶
- func All(slice []bool) bool
- func Any(slice []bool) bool
- func Find(slice *[]string, val string) (int, bool)
- func GenericRemove(equal func(string, string) bool, slice []string, val ...string) []string
- func ParseCommaSeparatedList(input string) []string
- func ParseListWithCleanup(input string, sep string) (newS []string)
- func ParseListWithCleanupKeepBlankLines(input string, sep string) (newS []string)
- func Remove(slice []string, val ...string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Find ¶
Find looks for an element in a slice. If found it will return its index and true; otherwise it will return -1 and false.
func GenericRemove ¶ added in v1.4.0
GenericRemove looks for elements in a slice using the equal function. If they're found, it will remove them from the slice.
func ParseCommaSeparatedList ¶
ParseCommaSeparatedList returns the list of string separated by a comma
func ParseListWithCleanup ¶ added in v1.9.0
ParseListWithCleanup splits a string into a list like strings.Split but also removes any whitespace surrounding the different items for example, ParseListWithCleanup("a, b , c", ",") returns []{"a","b","c"}
func ParseListWithCleanupKeepBlankLines ¶ added in v1.12.0
ParseListWithCleanupKeepBlankLines splits a string into a list like strings.Split but also removes any whitespace surrounding the different items unless the entire item is whitespace in which case it is converted to an empty string. For example, ParseListWithCleanupKeepBlankLines("a, b , c", ",") returns []{"a","b","c"} ParseListWithCleanupKeepBlankLines("a, b , , c", ",") returns []{"a","b", "", "c"}
Types ¶
This section is empty.