在 vb.net 中使用带有 shouldquote 的 csvhelper writer
using csvhelper writer with shouldquote in vb.net
我知道 shouldquote 如何与 c# 一起使用,但是有人在 vb.net 中有示例吗?
我需要用 chr(34) 包裹每个字段
Private Sub Main()
Dim records = New List(Of Foo) From {
New Foo With {
.Id = 1,
.Name = "one"
}
}
Dim config = New CsvConfiguration(CultureInfo.InvariantCulture) With {
.ShouldQuote = Function(args) True
}
Using csv = New CsvWriter(Console.Out, config)
csv.WriteRecords(records)
End Using
End Sub
Public Class Foo
Public Property Id As Integer
Public Property Name As String
End Class
我知道 shouldquote 如何与 c# 一起使用,但是有人在 vb.net 中有示例吗?
我需要用 chr(34) 包裹每个字段
Private Sub Main()
Dim records = New List(Of Foo) From {
New Foo With {
.Id = 1,
.Name = "one"
}
}
Dim config = New CsvConfiguration(CultureInfo.InvariantCulture) With {
.ShouldQuote = Function(args) True
}
Using csv = New CsvWriter(Console.Out, config)
csv.WriteRecords(records)
End Using
End Sub
Public Class Foo
Public Property Id As Integer
Public Property Name As String
End Class