summaryrefslogtreecommitdiff
path: root/AK/String.h
diff options
context:
space:
mode:
authorsin-ack <sin-ack@users.noreply.github.com>2021-06-18 16:21:27 +0000
committerLinus Groh <mail@linusgroh.de>2021-06-18 19:18:15 +0100
commit3abcfcc1785c13da29d205376f700084fead88be (patch)
treeb7be2f48d4d77d7e47eae0f48a22a4625bfb27b3 /AK/String.h
parent8be7bdaac371a26989f61b4fb7c2b61b77372bcc (diff)
downloadserenity-3abcfcc1785c13da29d205376f700084fead88be.zip
AK: Add a way to disable the trimming of whitespace in to_*int
This behavior might not always be desirable, and so this patch adds a way to disable it.
Diffstat (limited to 'AK/String.h')
-rw-r--r--AK/String.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/AK/String.h b/AK/String.h
index 6f9b98fdde..a3e70ba803 100644
--- a/AK/String.h
+++ b/AK/String.h
@@ -112,9 +112,9 @@ public:
[[nodiscard]] bool matches(const StringView& mask, Vector<MaskSpan>&, CaseSensitivity = CaseSensitivity::CaseInsensitive) const;
template<typename T = int>
- [[nodiscard]] Optional<T> to_int() const;
+ [[nodiscard]] Optional<T> to_int(TrimWhitespace = TrimWhitespace::Yes) const;
template<typename T = unsigned>
- [[nodiscard]] Optional<T> to_uint() const;
+ [[nodiscard]] Optional<T> to_uint(TrimWhitespace = TrimWhitespace::Yes) const;
[[nodiscard]] String to_lowercase() const;
[[nodiscard]] String to_uppercase() const;