Click here to Skip to main content
15,915,719 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I have a situation here. Let's say I dim some variable to hold a string data before save.

VB
Dim answer As String


Then I ready an input for user to fill. When they click save button, I will hold the data into "answer", let's say the data is an IP "192.168.0.1" but when the data is save, it will be 192.168.0.1 without quote "" right?

I want to save the data into text file. How could I save the data with the quotes? Is it possible. I've tried to save the double quotes into a string but it will save data without quotes.

Help me..
Posted

1 solution

Yes, it's possible. You just have to make the quotes part of the string itself.
Dim myData As String = """192.168.0.1"""

Now the value of the string will be "192.168.0.1", WITH the quotes. If you write that string to a file, it'll include the quotes.
 
Share this answer
 
Comments
fjdiewornncalwe 31-Oct-12 11:20am    
+5. The easy button. :)
Luiey Ichigo 5-Nov-12 20:57pm    
5*..thank you for your help.now i can save my data just like i need..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900