Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
if Insert Address like...

T2 Terminal International Airport,
MTNL Road,
Andheri,
Sakinaka,
Mumbai,
Maharashtra


in Rdlc report show like this
T2 Terminal International Airport, MTNL Road, Andheri, Sakinaka, Mumbai,Maharashtra.

please Suggest how to replace space with new line...

What I have tried:

=First(Fields!address.Value, "DataSet4").ToString().Replace(System.Environment.NewLine," ")


=Replace(First(Fields!address.Value, "DataSet4"),System.Environment.NewLine," ")
Posted
Updated 16-Apr-18 22:58pm
v2

1 solution

See System.String.Replace(String, String)[^]. The first parameter is the old value (the string to be replaced), and the second one is the string to be inserted. You have passed these parameters interchanged.

Note also that you probably want to replace the comma instead (with optional trailing space). Otherwise you would also split strings containing spaces like "T2 Terminal International Airport" from your example.

So use
C#
Replace(", ", System.Environment.NewLine)
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900