Click here to Skip to main content
13,588,673 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi i just want to created a RDLC report and i want to remove "\n" (newline constraint) from the string i got from database. then i wrote a Expression in the RDLC to remove it as follows

=First(Fields!conAddress.Value, "HAWBDt").ToString().Replace("\n"," ")

but it didn't worked.

the String i got form the database as follows and i want to remove that "\n" from the String.

2nd FloorHolden House,\n57 Rathbone Place,\nLondon,\nUK

if anyone could help me on this matter that would be a great help to me.thanks in advance!!!

Posted 16-Aug-12 2:53am
Updated 16-Aug-12 10:40am
Wes Aday 16-Aug-12 8:58am
It did not work because you are trying to get rid of a newline and it's a slash and an n in the string (not a newline).
Hesha 16-Aug-12 9:02am
yes.Agree.that's why i just put replace("\n", " ") so it should be replace? isn't it?
Wes Aday 16-Aug-12 9:07am
No! That is replacing the newline "\n". It is not a newline in your string is it? try \\n

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Try escaping the slash because you really mean a backslash in this case:
=First(Fields!conAddress.Value, "HAWBDt").ToString().Replace("\\n"," ")

Good luck!
21-Jan-17 0:06am
E.F. Nijboer 23-Jan-17 18:30pm
Pretty old post, but happy it could still help you out :D

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web02 | 2.8.180615.1 | Last Updated 16 Aug 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100