Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello our.Umbraco Community
I have a little Problem with the links on my website. The links are defined with http://www.example.com but i want to give out them like "www.example.com"
here is my code
foreach (var item2 in selection2) { <div class="row"> <div class="col-sm-1 col-xs-0"> </div> <div class="col-sm-5 col-xs-12"> <label class="subtitle mitabstand">@item2.LinkName<label> </div> <div class="col-sm-5 col-xs-12 text"> <p class="text"><a href="@item2.LinkURL" target="_blank">@item2.LinkURL</a></p> </div> </div> } <br /> }
by the first (href) i want to give it out normal: @item2.LinkName is: http://www.example.org
and by the second after the target="_blank" i want to give it out without http:// and https://
i think i have to make a new var and then do some string-modeling.
Can someone help me?
It's a simple C# string, so you can use the .NET Replace method on it.
@item2.LinkURL.Replace("http://","").Replace("https://","")
I'm sure there is a regex way to do it too, this is just an example :)
thank you so much
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
remove http:// and https://
Hello our.Umbraco Community
I have a little Problem with the links on my website. The links are defined with http://www.example.com but i want to give out them like "www.example.com"
here is my code
by the first (href) i want to give it out normal: @item2.LinkName is: http://www.example.org
and by the second after the target="_blank" i want to give it out without http:// and https://
i think i have to make a new var and then do some string-modeling.
Can someone help me?
It's a simple C# string, so you can use the .NET Replace method on it.
I'm sure there is a regex way to do it too, this is just an example :)
thank you so much
is working on a reply...