Contents Index Topic Contents | ||
Previous Topic: PathRemoveArgs Next Topic: PathRemoveBlanks |
PathRemoveBackslash
LPTSTR PathRemoveBackslash( LPTSTR lpszPath );Removes the trailing backslash from a given path.
- Returns the address of the NULL that replaced the backslash, or the address of the last character if it's not a backslash.
- lpszPath
- Address of the string from which to remove the backslash.
Example:
#include <windows.h> #include <iostream.h> #include "Shlwapi.h" void main( void ) { // Path with backslash. char buffer_1[] = "c:\\a\\b\\File\\"; char *lpStr1; lpStr1 = buffer_1; // Path before "PathRemoveBackslash". cout << "Path before calling \"PathRemoveBackslash\": " << lpStr1 << endl; // Call function "PathRemoveBackslash". PathRemoveBackslash(lpStr1); // Path after "PathRemoveBackslash". cout << "Path after calling \"PathRemoveBackslash\": " << lpStr1 << endl; } OUTPUT: ================== Path before calling "PathRemoveBackslash": c:\a\b\File\ Path after calling "PathRemoveBackslash": c:\a\b\File
Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.