mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-02 22:24:26 +00:00
AK: Add ByteString::to_number<T>
To mirror the API with StringView and String.
This commit is contained in:
parent
cdf84a3e36
commit
159eda5c6d
|
@ -119,6 +119,12 @@ public:
|
|||
[[nodiscard]] Optional<float> to_float(TrimWhitespace = TrimWhitespace::Yes) const;
|
||||
#endif
|
||||
|
||||
template<Arithmetic T>
|
||||
Optional<T> to_number(TrimWhitespace trim_whitespace = TrimWhitespace::Yes) const
|
||||
{
|
||||
return view().to_number<T>(trim_whitespace);
|
||||
}
|
||||
|
||||
[[nodiscard]] ByteString to_lowercase() const;
|
||||
[[nodiscard]] ByteString to_uppercase() const;
|
||||
[[nodiscard]] ByteString to_snakecase() const;
|
||||
|
|
Loading…
Reference in a new issue