185

What is the most efficient way to remove the first 3 characters of a string?

For example:

'apple' change to 'le'  
'a cat' change to 'at'  
' a b c'change to 'b c'
Skeets
  • 3,794
  • 37
  • 60
kafter2
  • 2,143
  • 3
  • 13
  • 11

2 Answers2

406

Just use substring: "apple".substring(3); will return le

Sergey Vedernikov
  • 7,433
  • 2
  • 24
  • 27
10

Use the substring method of the String class :

String removeCurrency=amount.getText().toString().substring(3);
Skeets
  • 3,794
  • 37
  • 60
Deepak Sharma
  • 4,811
  • 5
  • 47
  • 60