Oracle中的列,其中包含包含\n
的字符串,其返回\\n
代替单\n
。有没有办法获得数据库中的确切字符串?
//getting fileExposure from oracle db
List<FileExposure> fileExposure =dao.find(FileExposure.class,1);
//geting the string sample_data-->"this is a simple data\n for other features\n"
String sample_data=fileExposure.getSampleData();
//it returning "this is a simple data\\n for other features\\n"
答案 0 :(得分:1)
sample_data.replaceAll("\\\\n", "\\n")