There are 2 variables:

String one = "123456789"; String two = ""; 

I need to copy the value of the variable one to the variable two , starting at 5 digits.

How can I do that?

    1 answer 1

    You can use the substring(int beginIndex) method substring(int beginIndex) of the String class.

    If with 5 characters (inclusive), then:

     String one = "123456789"; String two = one.substring(4);