"Melissa" <melissa.mussitsch@ansys.comschrieb im Newsbeitrag
news:1161054969.551109.75750@m73g2000cwd.googlegro ups.com...
Thank you so much for your response. I think this gets me closer and
at least I know I'm not losing my mind!
Take it easy ;-)
>Leo - actually I think I've realized that I need to convert my html
>entity decimal value to hex. parseInt is not working the way I want it
>to at the moment, but I'll work through that. I think I'm just tired!
It's fairly simple. You could define a function that takes a string.
Get the position of an HTML entity ("&#").
If found (position -1), append characters up to this position to the
result variable.
Collect characters up to the next ";" or the end of the string.
Check that the characters are in fact a number.
Convert the number to hex, prefix with 0's if necessary. Append to the
output.
Remove chars from the input string up to the end of the entity.
Repeat until no more entities can be found.
Return the result string.
Such type of string parsing is fairly common practice. Unfortunately, it is
rarely taught. If you can't get it to work, post your code here, and we'll
se what we can do ;-)
Leo