0

I have a text view that holds a string "Hello World"

Currently because of view size it only shows "Hello Wo"

How can i make it display the end of the string instead e.g. "lo World"?

user2202098
  • 830
  • 1
  • 9
  • 24

1 Answers1

0

From the information you have provided, it's quite hard to understand what you are asking.

As far as I could understand your question, it's a string manipulation question rather than an Android question. If not please update your question and also provide layout XML code.

String a="Hello World"; //or whatever your actaul text is a=yourTextView.getText()
String b="Hello Wo"; //As you claim you know the exact length of the displayed text
String c=a.substring(a.length()-b.length(),a.length());

yourTextView.setText(c);

Hope this helps!!

Aman Tugnawat
  • 92
  • 1
  • 2
  • 12
  • As this is very rudimentary, I believe you are probably looking an answer to- "how to know the width of displayed text?" if so have a look at this [answer](http://stackoverflow.com/a/23923053/4382835). – Aman Tugnawat Oct 12 '16 at 01:35
  • Question was marked as dup. I found in that post setting ellipsize to start was the solution – user2202098 Oct 12 '16 at 09:12