I have a template (docx) and I have to replace keys words to content.
- Code: Select all
for (Object key : templateProperties.keySet()) {
textValue = textValue.replaceAll(key.toString().toUpperCase(),(String) templateProperties.get(key));
}
But during this replacement, a key word must be replace to a string with carriages returns. I would like analyze this string in order to locate the '\n' character and insert into the docx's XML a carriage return (I know this character and others like to '\r\n' or '^l' don't work).
- Code: Select all
if(templateProperties.get(key).toString().indexOf("\n")!=-1)
{
// Insert a carriage return
}
I tried severals methods without success.
Do you have any ideas for my problem ?
Thanks
Shex