mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +00:00
AK: Add String::ends_with{,_bytes}()
This commit is contained in:
parent
bfdbb4b6ed
commit
45dc3d8a3e
Notes:
sideshowbarker
2024-07-17 00:25:35 +09:00
Author: https://github.com/linusg
Commit: 45dc3d8a3e
Pull-request: https://github.com/SerenityOS/serenity/pull/17698
Reviewed-by: https://github.com/kennethmyhra ✅
2 changed files with 15 additions and 2 deletions
|
@ -491,14 +491,24 @@ bool String::contains(char needle, CaseSensitivity case_sensitivity) const
|
|||
return contains(StringView { &needle, 1 }, case_sensitivity);
|
||||
}
|
||||
|
||||
bool String::starts_with(u32 code_point) const
|
||||
{
|
||||
return bytes_as_string_view().starts_with(code_point);
|
||||
}
|
||||
|
||||
bool String::starts_with_bytes(StringView bytes) const
|
||||
{
|
||||
return bytes_as_string_view().starts_with(bytes);
|
||||
}
|
||||
|
||||
bool String::starts_with(u32 code_point) const
|
||||
bool String::ends_with(u32 code_point) const
|
||||
{
|
||||
return bytes_as_string_view().starts_with(code_point);
|
||||
return bytes_as_string_view().ends_with(code_point);
|
||||
}
|
||||
|
||||
bool String::ends_with_bytes(StringView bytes) const
|
||||
{
|
||||
return bytes_as_string_view().ends_with(bytes);
|
||||
}
|
||||
|
||||
bool String::is_short_string() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue