Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Remove first instance of character from a string only

(0) ShareShare
ReportReport
Posted on by

Hi guys,

 

I have a problem. I'd like to remove only the 1st extra "\" character from the following string using Power Automate. How can i do so?

 

DESKTOP-T01PAB4\\User

  • grantjenkins Profile Picture
    11,059 Super User 2025 Season 1 on at
    Re: Remove first instance of character from a string only

    If you were just trying to change duplicate \\ to \ then I'd do the following:

     

    replace('DESKTOP-T01PAB4\\User', '\\', '\')
  • Verified answer
    v-bofeng-msft Profile Picture
    on at
    Re: Remove first instance of character from a string only

    Hi @Starzap00 ,

     

    Please try:

    concat(
    take(
     'DESKTOP-T01PAB4\\User',
     indexOf('DESKTOP-T01PAB4\\User','\')
    ),
    skip(
     'DESKTOP-T01PAB4\\User',
     add(indexOf('DESKTOP-T01PAB4\\User','\'),1)
    )
    )

    Result:

    vbofengmsft_0-1678166743258.png

    Best Regards,
    Bof

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1