1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vlib: remove ustring usage (#10618)

This commit is contained in:
Daniel Däschle
2021-06-30 21:30:28 +02:00
committed by GitHub
parent 9d02ca51d1
commit 3881e97a40
14 changed files with 86 additions and 80 deletions

View File

@ -505,6 +505,18 @@ s := '42'
n := s.int() // 42
```
### Runes
A `rune` represents a unicode character and is an alias for `u32`. Runes can be created like this:
```v
x := `🚀`
```
A string can be converted to runes by the `.runes()` method.
```v
hello := 'Hello World 👋'
hello_runes := hello.runes() // [`H`, `e`, `l`, `l`, `o`, ` `, `W`, `o`, `r`, `l`, `d`, ` `, `👋`]
```
### String interpolation
Basic interpolation syntax is pretty simple - use `$` before a variable name.