suppose I have a string below.
"This is my string blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah"
I only want to show "This is my string" part and cut "blah" part.
So... I want to make my String as "This is my string" and do not want to
show my string as "this is my string blah blah blah blah".
Is there anyway to cut or limit String value in android?
Substring the string to 50 characters, which returns first 50 characters
You may need to something like this:
String s = blahString.substring(0,50);
Then set those to your textbox:
yourText.setText(s);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With