Hi
How do i remove the last part of a string if i dont no its lenght?
STRING mpt = macro_path(0)
This prints D:\lokalt\1 folder\more projektes
If I want to remove all after the last \ so I get D:\lokalt\1 folder
Solved! Go to Solution.
Solved by richard.pedley. Go to Solution.
STRING mpt = macro_path(0) STRING LIST tk = tokens($mpt, '/') $mpt = REPLACE($mpt, "/" + $tk[SIZE($tk)-1], "") MESSAGE INFO $mpt
Rafael Sansão
Take @rafael.sansao macro and edit / to \ and it works..
STRING mpt = macro_path(0) STRING LIST tk = tokens($mpt, '\') $mpt = REPLACE($mpt, "\" + $tk[SIZE($tk)-1], "") MESSAGE INFO $mpt
Hi PS,
The function dirname does this:
STRING $Test1 = macro_path(0) $Test1 = dirname($Test1)
That should sort it for you.
Hope that helps
Richard
Can't find what you're looking for? Ask the community or share your knowledge.