Here's a funny problem :
I have a text box in which the user can write a text . However in that text , the user may contain the " caracter . This may casue problems within the VB code when trying to retrive the text from the text box :
MyString = MyTextBox.Text
Therefore I'd like to replace the " character with two single lines : ' .
How can I do that ? Using the following code returns an error :
Replace(MyTextBox.Text , """ , "''")
(at the last part I used two single ' characters)
[Edited by iliekater on 15-08-2008 at 11:04 AM GMT]
15-08-2008 at 07:03 PM
|
GeoffS Level: VB Lord Registered: 29-09-2004 Posts: 543
Re: Replacing the " character within a string
Try this :-
Replace(MyTextBox, Chr(34), Chr(39))
____________________________ multi-tasking - the ability to hang more than one app. at the same time.