- Revenera Community
- InstallShield Forum
- How do I remove a backslash from the end of a string?
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Printer Friendly Page
How do I remove a backslash from the end of a string?
How can I check to see if there is a backslash at the end of a string, and if there is then remove the backslash?
My reason for asking is that I am able to find the path of my setup.exe executable using the code below. However if there is a backslash at the end of the path, I need to remove it. Does anyone know how I can do that?
szDir = PACKAGE_LOCATION;
// Note the above ParsePath command will store the directory path in strPathToInstallDir
// However there is a backslash at the end of the string : Ex: C:\Fulton\InstallationDir\
// I only need C:\Fulton\InstallationDir without the backslash at the end of the string.
Hi @ralphster ,
you can use StrRemoveLastSlash function to remove the last slash from the path string:
more information can be found at the below link: