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' ...