How can I parse unwanted characters from a data collection?
I am working with existing VB.NET code for a Windows application that uses StreamWriter and Serializer to output an XML transaction data document. The code is below.
Private TransactionFile As ProjectSchema.TransactionFile
Dim Serializer As New Xml.Serialization.XmlSerializer(GetType (ProjectSchema.TransactionFile))
Dim Writer As TextWriter
Dim FilePath As String
Writer = New StreamWriter(FilePath)
Serializer.Serialize(Writer, TransactionFile)
Writer.Close()
The XML document is loaded into another application that does not accept "crlf".
A "TransactionFile" is a dataset in a class called ProjectSchema.TransactionFile. It contains various types of data. There are 5 functions for creating nodes that contribute to the creation of a main transaction file called TransactionFile
I need to find the CRLF characters in the data collection and replace the CRLF characters with a space.
I can replace invalid field level characters:
.Name = Regex.Replace((Mid(CustomerName.Name, 1, 30)), "[^A-Za-z0-9\-/]", " ")
But I need to clear the entire data set.
If I try:
TransactionFile = Regex.Replace(TransactionFile, "[^A-Za-z0-9\-/]", " ")
TransactionFile String, " " ", " String "".
Bottom Line = CRLF , TransactionFile?