How to change text color for parts of text that are between two placeholders?

90 Views Asked by At

I have a TextView that may contain a text that number of placeholder is unknown. I need to change the color between all two pairs of <> (for some reason i can't add the 'B' letter between <> so please consider that in every place i'm writing <> a 'B' is existed between the brackets. For example, for the following string:"I twenty <>years<> old" -> the text should be with red color beside the parts between <> (am, years) that should be in blue color. The problem is that i can't know how much times the <> pairs is existed in the String.

0

There are 0 best solutions below