I have multiple strings with different formats that I need to display in some TextViews. I have no control over the length or the format of these strings. They could have numbers obly, text only, or a combination of both.
My goal is to display the strings in some TextViews, and in the process, convert any English numbers to Arabic numbers.
The following examples should clarify what I mean:
original string >> converted string
test 123 >> test ١٢٣
test >> test
123 >> ١٢٣
txtView.setText(String.format(locale, "%d", fulltext));
Lets say your fulltext string is this
String fulltext = "1a2b3c";
Replace the instances of all of the numbers with the corresponding Arabic numbers
fulltext = fulltext.replaceAll("1","١").replaceAll("2","٢").replaceAll("3","٣")
etc. Hopefully this is what you mean