Skip to content

Commit

Permalink
support unix line ending (LF), not only windows (CRLF) mjebrahimi#18
Browse files Browse the repository at this point in the history
  • Loading branch information
leo-schick committed Jun 10, 2023
1 parent 4dc42ea commit e8727b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Raptorious.SharpMt940Lib/Mt940Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ private static void Parse86Details(Transaction tr, Parameters mt940Params, bool

/// <summary>
/// This method accepts mt940 data file given as a string. The string
/// is split by Environment.NewLine as each line contains a command.
/// is split into lines as each line contains a command.
///
/// Every line that starts with a ':' is a mt940 'command'. Lines that
/// does not start with a ':' belongs to the previous command.
Expand All @@ -390,7 +390,7 @@ private static ICollection<string[]> CreateStringTransactions(IMt940Format forma
{
// Split on the new line seperator. In a MT940 messsage, every command is on a seperate line.
// Assumption is made it is in the same format as the enviroments new line.
var tokenized = data.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
var tokenized = data.Split(new string[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries);

// Create an empty list of string arrays.
var transactions = new List<string[]>();
Expand Down

0 comments on commit e8727b0

Please sign in to comment.