V version: V 0.1.23 c4a4363
OS: windows 10 (1909)
What did you do?
test substr, right, left string methods using REPL
What did you expect to see?
a := 'aabbcc'
println(a.substr(2,4))
bb
println(a.right(2))
bbcc
println(a.left(2))
aa
What did you see instead?
a := 'aabbcc'
println(a.substr(2,4))
.vrepl.v:2:16: functionsubstris private
println(a.right(2))
.vrepl.v:2:15: functionrightis private
println(a.left(2))
.vrepl.v:2:14: functionleftis private
Hi @progamateur , as per the last line of the top of https://github.com/vlang/v/issues/2932 --
string/array.left/right/slice/substr were removed ([a..b] slicing syntax should be used instead).
That is, instead of
println(a.left(2))
please use
println(a[..2])
and the like :slightly_smiling_face:
Hello elimisteve,
Sorry, i did't see the 0.1.23 new slicing syntax.
Thanks
Most helpful comment
Hello elimisteve,
Sorry, i did't see the 0.1.23 new slicing syntax.
Thanks