java从数据库中获取字符串,其中包含\n,改为获取\\n
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"
# 1 楼答案