vlib: simplify byte character conditions by using methods like is_capital, is_lower, is_letter etc (#21725)

This commit is contained in:
Turiiya 2024-06-25 08:55:08 +02:00 committed by GitHub
parent a536c03365
commit 5b9358279a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 22 additions and 29 deletions

View file

@ -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]
}