Question

6
Replies
429
Views
Gooner007 Member since 2010 15 posts
Tata Consultancy Services
Posted: 3 years ago
Last activity: 3 years 8 months ago
Closed

"\n" not working

Hi,

We are having the below code to display the content to the user.

{JAVA}

if (thisValue().length() > 0 && thisRef().hasValidValue())
{
String orgStr = thisValue();
int length = orgStr.length();
String nextlineStr = "\n";

if(length>15)
{
orgStr = orgStr.substring(0,17) + nextlineStr + orgStr.substring(17,orgStr.length());
for (int i=18;i+17<=length; i=i+17)
{
orgStr = orgStr.substring(0,i)+orgStr.substring(i,i+17)+ nextlineStr+ orgStr.substring(i+17,orgStr.length()); }
}

saveValueSet("result", orgStr);
}
else
{
saveValueSet("result", thisValue());
}

{/JAVA}

The Probelm for us is "\n" is not working. Instead of going to the next line it is adding a space. Anyone faced this issue before?

PEGA Version 5.5

Data Integration Java and Activities
Moderation Team has archived post
Share this page LinkedIn