参考这个帮助主题
我不知道如何让它在每个条目后不添加空格
例如
约翰玛丽乔
代替
约翰_玛丽_乔_
我如何得到它只是写条目
有问题的代码
Dim sb as new StringBuilder()
For Each item As Object In cmbworld.Items
'Dim test As String
'test = item
sb.AppendFormat("{0} {1}", item, Environment.NewLine)
Next
Dim FILE_NAME As String = "D:\Documents\test.txt"
If System.IO.File.Exists(FILE_NAME) = True Then
Dim objWriter As New System.IO.StreamWriter(FILE_NAME)
objWriter.Write(sb.ToString()) 'Use the stringbuilder here
objWriter.WriteLine()
objWriter.Close()
MsgBox("Text written to file")
Else
MsgBox("File Does Not Exist")
End If