mirror of
https://github.com/vlang/v.git
synced 2025-09-15 23:42:28 +03:00
vlib: simplify byte character conditions by using methods like is_capital, is_lower, is_letter etc (#21725)
This commit is contained in:
parent
a536c03365
commit
5b9358279a
10 changed files with 22 additions and 29 deletions
|
@ -39,7 +39,7 @@ pub fn (c u8) is_digit() bool {
|
|||
// Example: assert u8(`F`) == true
|
||||
@[inline]
|
||||
pub fn (c u8) is_hex_digit() bool {
|
||||
return (c >= `0` && c <= `9`) || (c >= `a` && c <= `f`) || (c >= `A` && c <= `F`)
|
||||
return c.is_digit() || (c >= `a` && c <= `f`) || (c >= `A` && c <= `F`)
|
||||
}
|
||||
|
||||
// is_oct_digit returns `true` if the byte is in range 0-7 and `false` otherwise.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue