Hi Guys,
Trying to figure out how to get the last space within a string and then extract all characters after the last space.
This is a dynamic string and not in all instances will the string have a space. I only need to extract all characters after the last space if there is a space.
Any help is greatly appreciated.
Thanks
I think the easiest way to do what you are asking is to use a combination of Split and Last functions.
Last(Split(<<string to extract from>>,' '))
Split will split the string into an array based on the spaces in the string. Then Last will give you whatever follows the last space.
This will return a Blank as there are no spaces,
With({myString:"Apples,Oranges,Bananas"},
If(IsMatch(myString, Space, Contains), Last(TrimEnds(Split(myString, " "))).Result, Blank())
)
This will return 🍌🍌🍌
With({myString:"Apples,Oranges, Bananas"},
If(IsMatch(myString, Space, Contains), Last(TrimEnds(Split(myString, " "))).Result, Blank())
)
Please remember to give a 👍 and accept my solution as it will help others in the future.