Hi All,
I am trying to extract text from a certain position in a string.
I need to get any text between the last two / symbols (eg 'extraction)
https://webaddress.com/extracttion/
Can anyone help?
Thank you!
Althoughthere is already a good solution provided by @ManishSolanki (and I would go for it), I want to show another easy way:
slice(
'https://webaddress.com/extracttion/',
add(nthINdexOf('https://webaddress.com/extracttion/', '/', -2), 1),
nthINdexOf('https://webaddress.com/extracttion/', '/', -1)
)
You can find the last positions in a string by using negative numbers as occurrence in nthIndexOf().
nthIndexOf('<text>', '<searchText>', <occurrence>)
Hi @kajelliott
Pls use the expression to extract the required text:
Below expression needs to bs added in the expression box as highlighted in the above screenshot:
trim(join(take(reverse(split('https://webaddress.com/extracttion/','/')),2),''))
Output:
If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.
Hi @kajelliott ,
Please try the expression:
first(reverse(take(split(outputs('Compose'), '/'),sub(length(split(outputs('Compose'), '/')),1))))
Best regards,
forgive the spelling - i was in a rush!
WarrenBelz
146,743
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,079
Most Valuable Professional