Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try escaping your double quotes by typing the <code>"</code> twice. Also I find String.Format is tidier than concatenation, and if you wrap your StreamWriter in a using block, you don't need to dispose of it, as this is done by the garbage collector.</p> <pre><code>Dim str1 As Integer = 1 Dim str2 As String = "Print_Me" Dim str3 As Single = 3.5 Dim str4 As String = "" Using fw As New System.IO.StreamWriter("testfile.txt") fw.WriteLine(String.Format("""{0}"",""{1}"",""{2}"",""{3}"",""0""", str1, str2, str3, str4)) End Using </code></pre> <p>Also, you could probably give your variables clearer names. Naming them after the type is considered bad practice, as it doesn't really give us any information about what information the variable holds. Prefixing an Integer or a Single with <code>str</code> is worse, as somebody reading your code could wrongly think that the variable is a string, and thus try and treat it like such.</p> <p>Edit: In response to your comment, first of all, in a VB.Net string, <code>""</code> represents a single instance of a double quote, if you want to remove a double quote, just remove the <code>""</code> and leave everything else intact. Secondly, it really doesn't matter if some of your strings are indirectly populated, you don't need to create a new variable to use them in a new string. In your code <code>tu</code> and <code>str2</code> are pointing at the same piece of data, as are <code>tu2</code> and <code>str4</code>, there is no need to create a new variable. If you have a piece of data held in a variable, you don't need to create a new variable to use it in a different way.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload