builtin: cleanup string trim()/trim_left()/trim_right() (#22225)

This commit is contained in:
yuyi 2024-09-16 01:05:42 +08:00 committed by GitHub
parent 9b88dc8deb
commit ca5f47a966
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 48 additions and 54 deletions

View file

@ -943,6 +943,7 @@ fn test_trim_left() {
s = 'banana'
assert s.trim_left('ba') == 'nana'
assert s.trim_left('ban') == ''
assert ''.trim_left('') == ''
}
fn test_trim_right() {
@ -954,6 +955,7 @@ fn test_trim_right() {
s = 'banana'
assert s.trim_right('na') == 'b'
assert s.trim_right('ban') == ''
assert ''.trim_right('') == ''
}
fn test_all_before() {