java - How to add a LineBreak (\n) to a String.format with fixed String as format? -
in code below, message final string have \n
inside it, , doesn't work.
message = format = "blah %d blah blah \nblah blah %s blah" interventionsize = number userid = string string.format(dic.message,interventionsize,userid)
how can make line break in case, cannot find answer.
btw, cannot use kind of framework or external jar (old code) have use plain old java.
having \n
in format string fine.
perhaps should try platform specific new-line. format strings can use %n
.
that is, try following:
string.format(dic.message.replace("\\n", "%n"), interventionsize, userid);
Comments
Post a Comment