IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
IKVM.Runtime.Extensions.PathExtensions Class Reference

Various extension methods for working with paths. More...

Static Public Member Functions

static string TrimEndingDirectorySeparator (string path)
 Trims any ending directory separator characters are removed from the path.
 
static string EnsureEndingDirectorySeparator (string path)
 Ensures the given path ends with a directory separator.
 

Static Public Attributes

static readonly char[] DirectorySeparatorChars = new char[] { Path.DirectorySeparatorChar }
 

Detailed Description

Various extension methods for working with paths.

Definition at line 9 of file PathExtensions.cs.

Member Function Documentation

◆ EnsureEndingDirectorySeparator()

static string IKVM.Runtime.Extensions.PathExtensions.EnsureEndingDirectorySeparator ( string path)
static

Ensures the given path ends with a directory separator.

Parameters
path
Returns

Definition at line 33 of file PathExtensions.cs.

34 {
35 return path[path.Length - 1] != Path.DirectorySeparatorChar ? path + Path.DirectorySeparatorChar : path;
36 }

◆ TrimEndingDirectorySeparator()

static string IKVM.Runtime.Extensions.PathExtensions.TrimEndingDirectorySeparator ( string path)
static

Trims any ending directory separator characters are removed from the path.

Parameters
path
Returns

Definition at line 19 of file PathExtensions.cs.

20 {
21#if NETFRAMEWORK
22 return path.TrimEnd(DirectorySeparatorChars);
23#else
24 return Path.TrimEndingDirectorySeparator(path);
25#endif
26 }
static readonly char[] DirectorySeparatorChars

Member Data Documentation

◆ DirectorySeparatorChars

readonly char [] IKVM.Runtime.Extensions.PathExtensions.DirectorySeparatorChars = new char[] { Path.DirectorySeparatorChar }
static

Definition at line 12 of file PathExtensions.cs.

12{ Path.DirectorySeparatorChar };

The documentation for this class was generated from the following file: