2021年1月6日星期三

fasterxml.jackson ObjectMapper's prettyPrint uses \r\n instead of \n

When running on windows I always get "\r\n" in the output, but I was trying to just return "\n"

    ObjectMapper objectMapper = new ObjectMapper();  return objectMapper.readTree("{\"key\":\"value\"}")      .toPrettyString();  

Is there a easy way to achieve this?

https://stackoverflow.com/questions/65605735/fasterxml-jackson-objectmappers-prettyprint-uses-r-n-instead-of-n January 07, 2021 at 10:07AM

没有评论:

发表评论