| author | |
| committer | |
| log | 208e95ff8ef4073ccb9f8ee5155ce4526b22b277 |
| tree | 05a5a607f33ff9c667aca618d2fb1341bab8a8d4 |
| parent | a236e1a08006fcdd61c666d2b4775c8161d7e709 |
1 files changed, 9 insertions(+), 0 deletions(-)
src/lib.zig+9| ... | ... | @@ -234,3 +234,12 @@ pub fn sortBy(comptime T: type, items: []T, comptime field: std.meta.FieldEnum(T |
| 234 | 234 | } |
| 235 | 235 | }.f); |
| 236 | 236 | } |
| 237 | ||
| 238 | pub fn containsString(haystack: []const string, needle: string) bool { | |
| 239 | for (haystack) |item| { | |
| 240 | if (std.mem.eql(u8, item, needle)) { | |
| 241 | return true; | |
| 242 | } | |
| 243 | } | |
| 244 | return false; | |
| 245 | } |