-4

Say String x = MynameisMary;

I want String Y to be "Mary"

How do i remove the first 8 characters to make Y equal to Mary??

BioPipeRex
  • 15
  • 5

1 Answers1

0

You could use the substring method:

String result = x.substring(8);
Mureinik
  • 297,002
  • 52
  • 306
  • 350