Can't seem to get either one of these to work:
I want to replace all "*" with ""
Two hours spent here...Code:a=replace(a,"*","")
a=replace(a,chr(42),"")
m=""
for i=1 to len(a)
t=mid(a,i,1)
if t<>"*" then m=m+t (tried chr(32) here also
next i
Printable View
Can't seem to get either one of these to work:
I want to replace all "*" with ""
Two hours spent here...Code:a=replace(a,"*","")
a=replace(a,chr(42),"")
m=""
for i=1 to len(a)
t=mid(a,i,1)
if t<>"*" then m=m+t (tried chr(32) here also
next i
Hmmm ...
Dim TmpString As String
TmpString="ABCD*EFGH*JIKLM*NOPQR*STUV*WXYZ*"
TmpString=Replace(TmpString,"/*","")
Should work ... I think it may have to do with VB treating the "*" as a wildcard. Try escaping it.
Nope. didn't work. Seems as if Replace isn't replacing anything right now.
I'm sort of new. What do you mean by the "escaping it"
tks
Instead of doing it like this:
TmpString=Replace(TmpString,"/*","")
Do the same but skip the slash.
TmpString=Replace(TmpString,"*","")
This works for sure.
Regards,
Michael
Mike,Quote:
Originally Posted by MichaelNattfalk
Replace works fine for me also ... Yaeh, the backslash was a bad idea ...
Cathy: Try recompiling your app and look to see if there are any invaid or missing references ...
I can make REPLACE work outside of this program.
I even have a lot of Replaces elsewhere in the code but
it just doesn't want to work at the place I have it.
????
I think I have found the problem but not exactly sure.
My replace was inside a WHILE statement and it affected
it somehow or another.
Thanks guys...