| 1 | // vtest vflags: -autofree |
| 2 | pub struct Test { |
| 3 | mut: |
| 4 | tags []string |
| 5 | } |
| 6 | |
| 7 | pub fn (mut t Test) set_tags(tags string) { |
| 8 | t.tags = tags.to_lower().replace(',', ' ').trim_space().split(' ') |
| 9 | } |
| 10 | |
| 11 | fn main() { |
| 12 | mut test := Test{} |
| 13 | test.set_tags('Hello, World') |
| 14 | println(test.tags) |
| 15 | } |
| 16 | |