mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +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
|
@ -134,7 +134,7 @@ pub fn split_capital(s string) []string {
|
|||
mut res := []string{}
|
||||
mut word_start := 0
|
||||
for idx, c in s {
|
||||
if c >= `A` && c <= `Z` {
|
||||
if c.is_capital() {
|
||||
if word_start != idx {
|
||||
res << s#[word_start..idx]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue