language-extensions/R/src/Utilities.cpp
//--------------------------------------------------------------------------------------------------
// Name: Utilities::NormalizePathString
//
// Description:
//  Normalizes path strings by replacting \ with / and the trailing / with a null terminator.
//
// Returns:
//  The normalized path string
//
:NormalizePathString
Description:
Normalizes path strings by replacting \ with / and the trailing / with a null terminator.

The normalized path string
: NormalizePathString Description : Normalizes path strings by replacting \ with / and the trailing / with a null terminator . The normalized path string
string Utilities::NormalizePathString(string pathString)
{
	replace(pathString.begin(), pathString.end(), '\\', '/');
	if (pathString.length() > 0 && *(pathString.end() - 1) == '/')
	{
		*(pathString.end() - 1) = '\0';
	}
	return pathString;
}
string Utilities :: NormalizePathString ( string pathString ) { replace ( pathString . begin ( ) , pathString . end ( ) , ' \\ ' , ' ' ) ; if ( pathString . length ( ) > 0 && * ( pathString . end ( ) - 1 ) == ' ' ) { * ( pathString . end ( ) - 1 ) = ' \0 ' ; } return pathString ; }
Name: Utilities::NormalizePathString
Description:
Normalizes path strings by replacting \ with / and the trailing / with a null terminator.
Name : Utilities :: NormalizePathString Description : Normalizes path strings by replacting \ with / and the trailing / with a null terminator .
// Replace trailing / with \0. //