How to retrieve portion of string

In The following exp

phoneno=codevalue+" "+phoneno

                                    How to retrieve phoneno alone using substring and index function

The 'index' function, return the position the found string.

The 'substring' function, retorna the part of a string, starting by index untill the quantity of the informed chars.


index("+55 987654321"," ") = 3

substring("+55 987654321",3,10) = 987654321

lenght("+55 987654321") = 13

letting it dinamic:

var phoneno = "+55 987654321"

var size = lenght(phoneno)

var index = index(phoneno," ")

substring(phoneno ,index,size-index)

any questions, let me know.