i want search specific string , replace same string without changing case.
lets have following string - 'good morning. good.', want search 'good' , highlight different color, have maintain same case.
i tried 'stringbyreplacingoccurrencesofstring()', problem here replaces 'good' 'good', need maintain case of string.
how can achieved?
- lowercase copy of string ie 'good morning...'
- iterate through string looking key words ie 'good'
- when found, record index , length in separate array.
- go original string , update colour.
Comments
Post a Comment