cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Remove all text after the last space in a string

Hi, All.

 

I need to remove all text after the last space in a string.  The issue is that the space could be a dynamic number of spaces.  For example:

 

my text that needs to stay remove.me

to 

my text that needs to stay

 

Or I could have a string as follows as well:

 

my name is fred remove.me

to 

my name is fred

 

Any help is appreciated.

1 REPLY 1
Highlighted
Super User III
Super User III

Hi @GoGorilla 

 

Here it is

 

image.png

 

 

Above expression I used is as follows:

 

replace(outputs('Compose'),last(split(outputs('Compose'),' ')),'')
 
Here is my test result
 
image.png


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Users online (16,707)