diff options
author | 2021-12-08 05:21:03 -0800 | |
---|---|---|
committer | 2021-12-16 19:18:51 -0800 | |
commit | 3036cbe5527a81ad9991d9ace27640af2d57e645 (patch) | |
tree | 928d2a02db08bb7219c94c52946eace437f6b6c3 /src/string_immutable.zig | |
parent | 393aa076bc0c8820e73a6f7e5a8d7753a118eb67 (diff) | |
download | bun-3036cbe5527a81ad9991d9ace27640af2d57e645.tar.gz bun-3036cbe5527a81ad9991d9ace27640af2d57e645.tar.zst bun-3036cbe5527a81ad9991d9ace27640af2d57e645.zip |
`bun add` and `bun remove` sorta works now. but not fast enough!
Diffstat (limited to 'src/string_immutable.zig')
-rw-r--r-- | src/string_immutable.zig | 1 |
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); } |