AK: Add DeprecatedFlyString::to_number<T>

This commit is contained in:
Shannon Booth 2023-12-23 14:09:17 +13:00 committed by Andreas Kling
parent 159eda5c6d
commit a4ecc65398

View file

@ -69,6 +69,12 @@ public:
DeprecatedFlyString to_lowercase() const;
template<Arithmetic T>
Optional<T> to_number(TrimWhitespace trim_whitespace = TrimWhitespace::Yes) const
{
return view().to_number<T>(trim_whitespace);
}
template<typename T = int>
Optional<T> to_int(TrimWhitespace = TrimWhitespace::Yes) const;
template<typename T = unsigned>