Andrew,
You are trying to search a binary string with an ASCII string representing the binary data. As was pointed out, you are not searching for binary 6A6D but literal string "6A6D".
Instead of using the number to hex string, use a typecast, which will convert the number to the decimal string.

You are also making things more complicated than they need to be for getting the 16-but numbers. Instead of converting the array to a U8 array then building a U16, just typecast the string to an array of U16's to begin with.

Also, if this was not example code and was in fact code to be put into a program, the result for offset match will always be 2 x index (assuming index is in range).
Message Edited by Matthew Kelton on
04-30-2008 10:17 AMMessage Edited by Matthew Kelton on
04-30-2008 10:21 AM