Skip to content

Commit

Permalink
Swap tabs to spaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
Diggory committed Aug 17, 2023
1 parent 11ca80c commit 5a5434c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions SwiftCSV/CSV.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ open class CSV<DataView : CSVView> {
/// - rowLimit: Amount of rows to parse (default is `nil`).
/// - Throws: `CSVParseError` when parsing `string` fails.
public init(string: String, delimiter: CSVDelimiter, loadColumns: Bool = true, rowLimit: Int? = nil) throws {
if string.hasPrefix(byteOrderMark) {
let trimmedString = string.dropFirst()
self.text = String(trimmedString)
} else {
self.text = string
}
if string.hasPrefix(byteOrderMark) {
let trimmedString = string.dropFirst()
self.text = String(trimmedString)
} else {
self.text = string
}
self.delimiter = delimiter
self.header = try Parser.array(text: self.text, delimiter: delimiter, rowLimit: 1).first ?? []
self.content = try DataView(header: header, text: self.text, delimiter: delimiter, loadColumns: loadColumns, rowLimit: rowLimit)
self.header = try Parser.array(text: self.text, delimiter: delimiter, rowLimit: 1).first ?? []
self.content = try DataView(header: header, text: self.text, delimiter: delimiter, loadColumns: loadColumns, rowLimit: rowLimit)
}

/// Load CSV data from a string and guess its delimiter from `CSV.recognizedDelimiters`, falling back to `.comma`.
Expand Down

0 comments on commit 5a5434c

Please sign in to comment.