cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
thirdimage

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors
Users online (6,544)