I'm having an issue when I read cells with '\' in it and then try to replace it to '\' because of java escape property.
For example: "Error: The provided P\jb credenti"
When I read this directly from a Cell using:
if (type == TStream.Spreadsheet) {
try {
FileInputStream stream = new FileInputStream(file);
Workbook workbook = Workbook.getWorkbook(stream);
Sheet sheet = workbook.getSheet(0);
int rows = sheet.getRows();
int ignored = 0;
int parsed = 0;
for (int i = 1; i < rows; i++) {
try {
Cell content = sheet.getCell(0, i);
And after that put it in an object that I made to store its information:
ObjectThatIMade object_= new ObjectThatIMade();
object_.setContent(content.getContents().replace("\\", "\\\\"));
It doesn't change the '\' to '\\', I did the same with replaceAll it doesn't work either. It stores in the same way and when I try to send it by JSON to my webservice, it won't work because of the '\' in the string, it gives me error.
Is there any way to guarantee that '\' is replaced by '\\'?
Thanks a lot for your time!