Replace an empty string with a hyphen

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
Hi Guys

Does anybody know how to do this !!!

What i am looking to do is pass a businessName like my-shop to the controller, I have set up a service and that works fine but I need to pass it the right parameter, and the only way I know is using the Replace but it does not work here.

Replace(Model.Name, ' ', '-')

Does anyone know how to achieve this please, any help would be most appreciated.

Kind Regards
Ron Palmer
11 years ago
How about
Model.Name.Replace(' ', '-')
11 years ago
(typo - remove first comma)
11 years ago
Thanks guys

I tried everything except for that :0)

Much appreciated.

Kind Regards
Ron
11 years ago
New York wrote:
(typo - remove first comma)

Thanks. Fixed
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.