v/vlib/v/fmt/tests/string_interpolation_keep.vv

20 lines
461 B
V

import os
fn main() {
println('Hello world, args: $os.args')
i := 123
a := 'abc'
b := 'xyz'
e := 'a: $a b: $b i: $i'
d := 'a: ${a:5s} b: ${b:-5s} i: ${i:20d}'
f := 'a byte string'.bytes()
println('a: $a $b xxx')
eprintln('e: $e')
_ = ' ${foo.method(bar).str()} '
println('(${some_struct.@type}, $some_struct.y)')
_ := 'CastExpr ${int(d.e).str()}'
println('${f[0..4].bytestr()}')
_ := '${generic_fn<int>()}'
_ := '${foo.generic_method<int>()}'
}