[RESOLVED] simple change in replacement
i have this code to add spaces between some symbols in a text box
VB Code:
With txtFileText
.Text = Replace(.Text, ">", " > ")
.Text = Replace(.Text, "<", " < ")
.Text = Replace(.Text, ".", " . ")
'.Text = Replace(.Text, """, " " ")
End With
what should i change in the last replacment to let me add spaces for the symbol "
Re: simple change in replacement
VB Code:
.Text = Replace(.Text, Chr(34), Chr(32) & Chr(34) & Chr(32))
:)
Re: simple change in replacement
"""" is the same as chr(34)
" "" " is the same as " " & Chr(34) & " "
VB Code:
.Text = Replace(.Text, """", " "" ")
Re: simple change in replacement
VB Code:
With txtFileText
.Text = Replace(.Text, ">", " > ")
.Text = Replace(.Text, "<", " < ")
.Text = Replace(.Text, ".", " . ")
Dim x As String
x = Chr(34) ' ascii for "
'.Text = Replace(.Text, x, " " & x & " ")
End With
Did it help?
Re: simple change in replacement
i tried the three ways and all works :bigyello:
thanks everyone :wave: