Component UtilitiesCorrect File Path Separators Method
This is used to ensure that DirectorySeparatorChar is used to separate the parts
of a file path.
Definition
Namespace: Sandcastle.Core
Assembly: Sandcastle.Core (in Sandcastle.Core.dll) Version: 2026.1.20.0
The file path with the directory separators corrected if necessary
Assembly: Sandcastle.Core (in Sandcastle.Core.dll) Version: 2026.1.20.0
C#
public static string CorrectFilePathSeparators(
this string path
)VB
<ExtensionAttribute>
Public Shared Function CorrectFilePathSeparators (
path As String
) As StringC++
public:
[ExtensionAttribute]
static String^ CorrectFilePathSeparators(
String^ path
)F#
[<ExtensionAttribute>]
static member CorrectFilePathSeparators :
path : string -> string Parameters
- path String
- The file path to check
Return Value
StringThe file path with the directory separators corrected if necessary
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).Remarks
This ensures proper file paths regardless of the current operating system