Hi Dear Admin
Please guide me which way is better for replacing emoticons characters with it's picture:
1- parsing character by character and compare with emoticons code!
my emoticons are over 800 code.
or
2- find emoticons character in a loop for all codes and replace it with it's picture!
thanks a lot
Replace text with picture!
-
- Site Admin
- Posts: 17564
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I suggest parsing text and searching for empoticons code.
A basic code can be taken from http://www.trichview.com/forums/viewtopic.php?t=63 , but, for 800 emoticons, EmoticonAtIndex function must be implemented more efficiently.
For example, you can have array of sorted string lists, SL[N] contains codes of length N.
When searching for emoticons, you search in SL[2], then SL[3], etc. Use SL[N].Find, it's very efficient, because it implements binary search.
A basic code can be taken from http://www.trichview.com/forums/viewtopic.php?t=63 , but, for 800 emoticons, EmoticonAtIndex function must be implemented more efficiently.
For example, you can have array of sorted string lists, SL[N] contains codes of length N.
When searching for emoticons, you search in SL[2], then SL[3], etc. Use SL[N].Find, it's very efficient, because it implements binary search.