Static Public Member Functions | List of all members
StringExtensions Class Reference

Detailed Description

Polyfill for string things I expect in the .net libraries

using DWulf.LanguageExtensions; will get you access to these.

Static Public Member Functions

static string  NoTrailingSlash (this string s)
 
static string  Dirname (this string s)
 
static string  Filename (this string s)
 
static string  Basename (this string s)
 
static string  Extension (this string s)
 

Member Function Documentation

◆ Basename()

static string Basename ( this string  s )
inlinestatic

like the bash tool, get the basename only.

assumes there is a file on the end. Uses forward slash on all platforms.

Parameters
s
Returns

◆ Dirname()

static string Dirname ( this string  s )
inlinestatic

like the bash tool, get the pathname only, no trailing slash.

assumes there is a file on the end. Does not add trailing slash. Uses forward slash on all platforms.

Parameters
s
Returns

◆ Extension()

static string Extension ( this string  s )
inlinestatic

like the bash tool, get the extension only.

assumes there is a file on the end. Returns the period too. Uses forward slash on all platforms.

Parameters
s
Returns

◆ Filename()

static string Filename ( this string  s )
inlinestatic

like the bash tool, get the basename and extension.

assumes there is a file on the end. Uses forward slash on all platforms.

Parameters
s
Returns

◆ NoTrailingSlash()

static string NoTrailingSlash ( this string  s )
inlinestatic

Remove a trailing slash, if there is one.

Uses forward slash on all platforms.

Parameters
s
Returns