Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Function ReplaceBadWords(InputComments) Dim badChars, newChars, sLength, sAttachtoEnd, x, i 'create an array of bad words that should be filtered badChars = array("rubbish", "crap", "shit", "cunt", "bastard", "prick", "fuck") newChars = InputComments 'loop through our array of bad words For i = 0 to uBound(badChars) 'get the length of the bad word sLength=Len(badChars(i)) 'we are going to keep the first letter of the bad word and replace all the other 'letters with *, so we need to find out how many * to use For x=1 to sLength-1 sAttachtoEnd=sAttachtoEnd & "*" Next 'replace any occurences of the bad word with the first letter of it and the 'rest of the letters replace with * newChars = Replace(newChars, badChars(i), Left(badChars(i),1) & sAttachtoEnd) sAttachtoEnd="" Next ReplaceBadWords = newChars End function
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.