Any way to slice a string by index?

Does Verse support any way to slice a string?

For example in Python and Javascript

>>> item = 'string here'
>>> item[2:]
'ring here'
> const item = 'string here'
> item.slice(2)
'ring here'

I am able to do something similar with the Slice function and arrays:

Items : []string = array{"zero", "one", "two", "three", "four"}
var Modified : []string = array{}
if (set Modified = Items.Slice[1, 3]){}

Edit: never mind… that same technique works for strings

var X : string = "string here"
var Y : string = ""
if (set Y = X.Slice[2, X.Length]){}
Print(Y)

(Prints ‘ring here’)

1 Like

Glad you got it sorted!

1 Like