191

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
  • 4,476
  • 2
  • 41
  • 67
kafter2
  • 2,223
  • 3
  • 14
  • 11

2 Answers2

417

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

Sergey Vedernikov
  • 7,609
  • 2
  • 25
  • 27
10

Use the substring method of the String class :

String removeCurrency=amount.getText().toString().substring(3);
Skeets
  • 4,476
  • 2
  • 41
  • 67
Deepak Sharma
  • 4,999
  • 5
  • 51
  • 61