You need to sign in to do that
Don't have an account?
mariappangomathiraj
How to add '|' symbol to string in apex controller?
string s = '|'+'Test';
system.debug(Logginglevel.ERROR,'::::s3:::::::'+s);
Output:
::::s3:::::::|Test
Expected Output:
::::s3::::::: |Test
Is it possible to get the above output?
I just executed in the developer console. It is comming so it should also come in the apex controller.
Hi,
I also executed in developer console and it is showing expected output. but when see in debug console than it show me {.
how......
Hi
The way ur using is correct when using system.debug to see the output it showing different but if ur storing this value in any field it showing the correct value.i tried this string s = '|'+'Test'; in a trigger it worked perfectly.
Instead of using system.debug().just try system.assert to compare the value.
try
'\|'
It's not in the actual log since we use that as a parse token, but we render it in the log view as '|'. The raw log will show the encode value.
c.Description = "First line";
for (Integer k=1; k<nFields; k++)
{
c.Description = c.Description + '\n' + newlines[k];
}