Find > in a string

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Im tring to replace > with ""
sUpcDescription = sUpcDescription.Replace(">", "")
But for some reason its not reconizing ">". Is there a char for this symbol.
 
Try using the Instr & Chr Functions like this

If InStr(1, sUpcDescription, Chr(62), vbBinaryCompare) Then
sUpcDescription = Replace(sUpcDescription, Chr(62), "", 1, 1)
 
Sub test()
Dim s1 As String, s2 As String
s1 = "A>B>C"
s2 = Replace(s1, ">", "")

MsgBox s1 & vbCr & s2
End Sub

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top