From: Brendan Hansen Date: Tue, 7 Mar 2023 21:37:04 +0000 (-0600) Subject: added: `u8.is_whitespace` X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=fc2e109d0cd7c840a7d3ece9a8f8fed158bb2145;p=onyx.git added: `u8.is_whitespace` --- diff --git a/core/string/char_utils.onyx b/core/string/char_utils.onyx index 86756eba..800913f3 100644 --- a/core/string/char_utils.onyx +++ b/core/string/char_utils.onyx @@ -21,6 +21,10 @@ package core.string is_alphanum :: (c: u8) -> bool { return c->is_alpha() || c->is_num(); } + + is_whitespace :: (c: u8) -> bool { + return c == #char " " || c == #char "\n" || c == #char "\t" || c == #char "\v"; + } }