If you string returns like you show you could check for the commas also: ,7, which would not give any other numbers, like 17, 27, etc.
find(yourText,",7,")
will return > -1 if found (returns the index position)
This one will do just what you need short and effective.
the bit where the 7 is between commanas can be changed too
needle = 7
haystack = "1,2,3,4,5,6,7,8,10,17,27,"
result = find(haystack,","&needle&",")
result will be 0 (indicating it occured one)
needle = 11
haystack = "1,2,3,4,5,6,7,8,10,17,27,"
result = find(haystack,","&needle&",")
result will be -1
needle = 1
haystack = "1,2,3,4,1,5,6,7,8,10,1,17,27,"
result = find(haystack, ","&needle&"," )
result will be 2
The provided codes adds the commas before and after, but this could be changed to suite your needs.