aha! Using replace twice - awesome Idea! I would write it like this: function CharCount pAsciiChar,pString put numtochar(pAsciiChar) into tCharToCheck put pString into pString2 replace tCharToCheck with empty in pString2 return (the length of pString)-(the length of pString2) end CharCount Awesome thinking Cubist!