title: remove line break from string variable in VBA
body: <p>I have declared and assigned a value to a string variable in VBA.</p>
  
  <p>The variable contains a number of line breaks, can you advise how to remove these, this variable has been assigned a value from an xml document using the following code:-</p>
  
  <pre><code>s = Application.GetOpenFilename() 
  
  myFolder = ActiveWorkbook.Path
  s = Dir(myFolder &amp; "\*.xml")
  
  Do While s &lt;&gt; ""
  
  If s &lt;&gt; "False" Then
  
      Set FSO = CreateObject("Scripting.FileSystemObject")
          If FSO.FileExists(s) Then
  
          t = myFolder &amp; "\" &amp; Replace(FSO.GetTempName(), ".tmp", ".xml")
  
         Name s As t
          Set ts(0) = FSO.OpenTextFile(t, 1, False, -2) 
  
          FileContents = ts(0).READALL                
  
     ts(0).Close
         Set ts(0) = Nothing
  
     End If
  End If
  
    s = Dir$ 
  
  loop
  </code></pre>
  
  <p>Can anyone advise a solution?</p>
  
  <p>Thanks Nick</p>