Code:
m$ = " and and and God the and and " s$ = " and " REPLACE $SPC WITH $SPC + $SPC IN m$ ' make single spaces into double spaces m$ = $SPC + TRIM$(m$) + $SPC ' make sure the string starts and ends with a space t = TALLY m$, s$
Shawn, in your case, this code will return the value 2 for you:
Code:
myString$="userPW=shawn&userID=shawn&ver=97&samID_1=555&dvm_555=75&tsd_555=3&krcCasa_555_1=&hemaID_555_1=&s1a_555_1=&s1b_555_1=&s1c_555_1=&s2a_555_1=&s2b_555_1=&s2c_555_1=&divisor_555_1=.77&hemaID_555_2=&s1a_555_2=&s1b_555_2=&s1c_555_2=&s2a_555_2=&s2b_555_2=&s2c_555_2=&divisor_555_2=.77&ctech_555=shawn&samID_2=777&dvm_777=47&tsd_777=0&krcCasa_777_1=&hemaID_777_1=&s1a_777_1=&s1b_777_1=&s1c_777_1=&s2a_777_1=&s2b_777_1=&s2c_777_1=&divisor_777_1=.77&ctech_777=shawn" t = TALLY myString$, "samID_"
Leave a comment: