Here is a sample: - playing with markup styles
function instrword(string s,k) as int
to find whole words in a string
Parameters:
s is the string to be searched
k is the keyword to be located in s
Return:
the index of the first position of k in s
if the search fails then the return value is 0
function instrword(string s,k) as int
=====================================
/**
to find whole words in a string
@param s is the string to be searched
@param k is the keyword to be located in s
@return the index of the first position of k in s
if the search fails then the return value is 0
**/
int lk=len k
int ,lb,rb
byte b at strptr(s)
if not k then return 0
int i=1
do
i=instr(i,s,k)
if i=0
return 0
endif
lb=i-1
rb=i+lk
if b[ rb ]<48
if i=1
return 1
elseif b[ lb ]<48
return i
endif
endif
i+=lk
loop
end function