mercredi 6 février 2019

Convert a string with a particular pattern to a checkbox

I am trying to convert a string with a special pattern to checkboxes. The pattern is the following: [ ] and [x]. How do I make it looks like this

Here are the patterns in strings

Converted edit text

Here is what I want to make it look like:

Converted edit text

I want to create a checkbox where the string pattern is [ ] and a checked box where string pattern is [x].

I have tried to look for the pattern in a string using something.contains("[ ]"), it works but I do not know how to make it look like a checkbox/checkedbox.

Any solution to it?




Aucun commentaire:

Enregistrer un commentaire