web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to remove a substr...
Power Apps
Answered

How to remove a substring from string.

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all, 

 

I have the following string which is "A|B|C|D" and trying to remove a substring without losing the structure as I read them into a collection when I split them with "|". 

 

My question is How do I remove a substring( It can be "A" or "B" or "C") without altering the "|" in the structure. 

 

Note : The substring is a parameter ( This can be "A" or "B" or "C"). 

 

I am not sure if this is correct, But tried with Forall formula and reconstructing the string using concatenate.

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    You can approach it from either the String perspective or the resulting split.

     

    For example, with the split, you can use:

    Filter(
     Split("A|B|C|D", "|"),
     !(Result="B")
    )

    This would return your Split without the B item.

     

    Similarly, you can turn it back into a string if you just want to alter the string value.

    Ex:

    Concat(
     Filter(
     Split("A|B|C|D", "|"),
     !(Result="B")
     ),
     Result & "|"
    )

    The above would produce "A|C|D|"

     

    And of course, you can just alter the string directly if that fits the scenario.

    Ex.

    Substitute("A|B|C|D", "|B", "")

    That would produce: "A|C|D"

     

    I hope this is helpful for you.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @RandyHayes , Thank you. This worked!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard