Menu

#36 How do escape quotes with escape character?

v1.0 (example)
closed
None
5
2015-07-30
2015-07-30
Steiny
No

Is there a way to escape quotes with the escape character instead of two quotes?

Discussion

  • Scott Conway

    Scott Conway - 2015-07-30

    From your question I am assuming you are talking about the CSVWriter?

    If so it is actually using the escape character it is just that the default escape character for CSVWriter is the quote.

    Just use one of the CSVWriter constructor that sets the escape character and set it to what you want.

     
  • Steiny

    Steiny - 2015-07-30

    Sorry I just realised I got the expected and actual from my test the wrong way around (I'm replacing the parser used by an existing test). Yes your right I had overridden the escape character to be "\". Thanks!

     
  • Scott Conway

    Scott Conway - 2015-07-30
    • status: open --> closed
    • assigned_to: Scott Conway
     
  • Scott Conway

    Scott Conway - 2015-07-30

    Not a problem - I like problems with simple fixes :)

     

Log in to post a comment.

MongoDB Logo MongoDB