cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
golfnutt82
Super User
Super User

Replace a blank char with a hyphen

Hello,
I have a variable called strSiteName and it is possible for the site name to have blank spaces like I like cats 05-31-2022 but I dont want spaces in my string as it is used to build a URL and %20 causes undesirable effects in an HTTP call down the line.
For the life of me I am not able to get my replace expression to work no matter what I try.
Please let me know what I could be missing or doing wrong.
Thank you

Replace(variables('strSiteName')'" "','-') or
Replace(variables('strSiteName')'','-') or

Replace(variables('strSiteName')'%20','-')

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
MarvinBangert
Super User
Super User

Hi @golfnutt82 

you are missing a comma after your variable().

This should work:

Replace(variables('strSiteName'),' ','-')

 

Does this help you? Otherwise please give me some more information.

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

Blog: Cloudkumpel

View solution in original post

2 REPLIES 2
MarvinBangert
Super User
Super User

Hi @golfnutt82 

you are missing a comma after your variable().

This should work:

Replace(variables('strSiteName'),' ','-')

 

Does this help you? Otherwise please give me some more information.

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

Blog: Cloudkumpel

Thanks Marvin! SMH

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (3,941)