diff options
Diffstat (limited to 'v_windows/v/vlib/builtin/js/byte.js.v')
-rw-r--r-- | v_windows/v/vlib/builtin/js/byte.js.v | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/v_windows/v/vlib/builtin/js/byte.js.v b/v_windows/v/vlib/builtin/js/byte.js.v new file mode 100644 index 0000000..af1803b --- /dev/null +++ b/v_windows/v/vlib/builtin/js/byte.js.v @@ -0,0 +1,16 @@ +module builtin + +pub fn (b byte) is_space() bool { + mut result := false + #result.val = /^\s*$/.test(String.fromCharCode(b)) + + return result +} + +pub fn (c byte) is_letter() bool { + result := false + + #result.val = (c.val >= `a`.charCodeAt() && c.val <= `z`.charCodeAt()) || (c.val >= `A`.charCodeAt() && c.val <= `Z`.charCodeAt()) + + return result +} |