mirror of
https://github.com/vlang/v.git
synced 2025-09-16 07:52:32 +03:00
builtin: add @[direct_array_access]
to js string trim_right method (#20222)
This commit is contained in:
parent
93756d2027
commit
4bab3e700e
1 changed files with 1 additions and 0 deletions
|
@ -285,6 +285,7 @@ pub fn (s string) u8() u64 {
|
|||
|
||||
// trim_right strips any of the characters given in `cutset` from the right of the string.
|
||||
// Example: assert ' Hello V d'.trim_right(' d') == ' Hello V'
|
||||
@[direct_array_access]
|
||||
pub fn (s string) trim_right(cutset string) string {
|
||||
if s.len < 1 || cutset.len < 1 {
|
||||
return s.clone()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue