How would a compose an output to remove the last element of an array? My specific use case would be to remove an extension from a file name..
For example, I have a file name called: this.is.a.test.txt
Desired output: this.is.a.test
Thanks!
How would a compose an output to remove the last element of an array? My specific use case would be to remove an extension from a file name..
For example, I have a file name called: this.is.a.test.txt
Desired output: this.is.a.test
Thanks!
Hi @cchicken
As @Julien2 suggested you should use substring function achieve this, I would prefer to add on the solution is to get the length of the last element dynamically:
MyString is variable storing : this.is.a.test.txt (You can actually use any other string )
Hi @cchicken ,
The substring function allows extracting part of a string. I have specified where to start at position 0 and how many characters I want.
To find how many characters to take, I have used the length expression to give me the string length for the result.
If I have answered your question, please mark your post as Solved.
Thank you.
Hi @cchicken ,
This expression might help you:
substring(outputs('Compose'),0,sub(length(outputs('Compose')),4))
I hope it helps!
Regards,
Julien
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1