Can someone tell me why the following isn't working? I'm trying to strip all the commas out of a string using the filter function and it keeps throwing a type mismatch error. Here's the code:
dim sFirstString as string
dim sResultString() as string
dim sComma as string
sComma = ","
sFirstString = "John Doe, 1111 1st Street, No Town, TX, 77777"
sResultString = filter(sFirstString, sComma, False)
Yes, I know I could do this with split and join, but I wanted to try the filter function. If I understand the I should be getting sResultString = "John Doe 1111 1st Street No Town 77777" , but instead I keep getting the "type mismatch" error.
Can any one tell me what I'm doing wrong?
Thanks in advance.
dim sFirstString as string
dim sResultString() as string
dim sComma as string
sComma = ","
sFirstString = "John Doe, 1111 1st Street, No Town, TX, 77777"
sResultString = filter(sFirstString, sComma, False)
Yes, I know I could do this with split and join, but I wanted to try the filter function. If I understand the I should be getting sResultString = "John Doe 1111 1st Street No Town 77777" , but instead I keep getting the "type mismatch" error.
Can any one tell me what I'm doing wrong?
Thanks in advance.