I'm trying to write a code that will remove it from a file and app address. To remove the address to the \ last. How can I do this?
old_path = C:\\Users\zivsi\AppData\Local\WhatsApp\WhatsApp.exe
*event* remove up to the last \
new_path = WhatsApp.exe
old_path = C:\\Users\zivsi\Desktop\alarm.exe
*same event* remove up to the last \
new_path = alarm.exe