- Revenera Community
- :
- InstallShield
- :
- 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
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
How do I remove a backslash from the end of a string?
Hello,
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;
ParsePath(strPathToInstallationDirectory,szDir,PATH)
// 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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
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:
