cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
yasminSarbaoui
Level: Powered On

Deleting part of a string from a label

Good morning everyone. I have some troubles with a string.

Let's say i obtain a general string of type:  http://xxx/mine/base/name.pdf

I need to remove the last part of the string after the last "/" to obtain http://xxx/mine/base/ but i'm having troubles using right left mid (as i don't know in advance the number of characters to remove) and with find aswell (as it finds me the first "/" in the string with no information on the others).

I've also tried to see if i could reverse the string but found no functions for it.

 

Do you have any ideas on how to make it?

Thanksss

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Deleting part of a string from a label

Hi @yasminSarbaoui 

You can use Split function to accomplish this. This function splits a string into a table of substrings.

https://docs.microsoft.com/en-gb/powerapps/maker/canvas-apps/functions/function-split

 

The formula you would use would look something like this. You can obviously replace the hardcoded URL with your data value.

Concat(FirstN(Split("http://xxx/mine/base/name.pdf", "/").Result,
      CountRows(Split("http://xxx/mine/base/name.pdf", "/").Result)-1),Result & "/"
)

image.png

 

View solution in original post

2 REPLIES 2
Super User
Super User

Re: Deleting part of a string from a label

Hi @yasminSarbaoui 

You can use Split function to accomplish this. This function splits a string into a table of substrings.

https://docs.microsoft.com/en-gb/powerapps/maker/canvas-apps/functions/function-split

 

The formula you would use would look something like this. You can obviously replace the hardcoded URL with your data value.

Concat(FirstN(Split("http://xxx/mine/base/name.pdf", "/").Result,
      CountRows(Split("http://xxx/mine/base/name.pdf", "/").Result)-1),Result & "/"
)

image.png

 

View solution in original post

yasminSarbaoui
Level: Powered On

Re: Deleting part of a string from a label

Great it's working. I guess it's what i was trying to do with subString

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,740)