Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing comma from the string in rdlc

Tags:

string

rdlc

How to remove comma from the end of a string in RDLC text box formula field?

Here is the expression:

=Fields!Titles.Value
like image 538
asma Avatar asked May 30 '26 14:05

asma


1 Answers

If you're sure there won't be any other commas (and are okay with removing all of them), you can replace the commas with nothing, like this:

=Replace(Fields!Titles.Value, ",", "")

If there could be commas elsewhere in the fields that you don't want to remove (and you want to remove commas occurring at the end of the field only), you could do something like this:

=iif(Right(Fields!Titles.Value, 1) = ",", 
     Left(Fields!Titles.Value, Len(Fields!Titles.Value)-1),
     Fields!Titles.Value)

If there can be whitespace before or after the comma, you'll need to add handling for that also (use Trim, LTrim, and RTrim as needed for your situation).

like image 76
Ennael Avatar answered Jun 02 '26 21:06

Ennael