Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

replace a char in a string

Status
Not open for further replies.

tyris

Programmer
Nov 2, 2000
311
0
0
FR
hi all,

i searched how to do this, but found only a begin of response ...
could you help me ?

i need to search the character "'" in a string, and each time i find one, to replace it with an other character.

i know that i cant use len() to get the length of the string, that i can use InStr() to compare it with the "'" character ... and then, how to do ?
advices are welcome
best regards,

elise
Best regards,
Elise
 
Visual Basic has a built in function to do this.
here's an example that may help.

Public Function RemoveQuote(sString2Change As String) As String
RemoveQuote = Replace(sString2Change, "'", " ")
End Function

The Replace function is the key. the first parameter is the string that has the character in it. The second is the character you want to change. And the third is what you want to replace it with. In this case it blanks it out.

Hope it helps
 
yes i had seen the small mistake ;-)
thanks a lot

elise Best regards,
Elise
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top