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.zig1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/string_immutable.zig b/src/string_immutable.zig
index d9c29b1ea..2f14d7e28 100644
--- a/src/string_immutable.zig
+++ b/src/string_immutable.zig
@@ -241,6 +241,7 @@ test "StringOrTinyString Lowercase" {
try std.testing.expectEqualStrings("hello!!!!!", str.slice());
}
+/// startsWith except it checks for non-empty strings
pub fn hasPrefix(self: string, str: string) bool {
return str.len > 0 and startsWith(self, str);
}