-1

I've a string with complete language name and I wanted to set first two characters of that language name to my text view. Like I've a language name AFRIKAANS and I only wanted to set AF on my text view. How can I do this

2 Answers2

0

you can use substring method like this

"AFRIKAANS".substring(0,2)
saeedata
  • 901
  • 6
  • 14
0
String string = "AFRIKAANS";
yourTextView.setText(string.substring(0, 2));
Karjalaz
  • 16
  • 2