aboutsummaryrefslogtreecommitdiff
path: root/src/string_immutable.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/string_immutable.zig')
-rw-r--r--src/string_immutable.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/string_immutable.zig b/src/string_immutable.zig
index 25d4fb01a..3d1724d4e 100644
--- a/src/string_immutable.zig
+++ b/src/string_immutable.zig
@@ -127,6 +127,11 @@ pub inline fn indexAnyComptime(target: string, comptime chars: string) ?usize {
return null;
}
+pub inline fn indexEqualAny(in: anytype, target: string) ?usize {
+ for (in, 0..) |str, i| if (eqlLong(str, target, true)) return i;
+ return null;
+}
+
pub fn repeatingAlloc(allocator: std.mem.Allocator, count: usize, char: u8) ![]u8 {
var buf = try allocator.alloc(u8, count);
repeatingBuf(buf, char);