C# Class PowerArgs.StringEx

string extension methods
Datei anzeigen Open project: adamabdelhamed/PowerArgs

Public Methods

Method Description
ToBlack ( this s, ConsoleColor bg = null ) : ConsoleString

Changes the foreground of this string to black, and optionally forces the background of all characters to the given color.

ToBlue ( this s, ConsoleColor bg = null ) : ConsoleString

Changes the foreground of this string to blue, and optionally forces the background of all characters to the given color.

ToConsoleString ( this s, ConsoleColor fg = null, ConsoleColor bg = null ) : ConsoleString

Converts a string to a ConsoleString

ToCyan ( this s, ConsoleColor bg = null ) : ConsoleString

Changes the foreground of this string to cyan, and optionally forces the background of all characters to the given color.

ToDarkBlue ( this s, ConsoleColor bg = null ) : ConsoleString

Changes the foreground of this string to dark blue, and optionally forces the background of all characters to the given color.

ToDarkCyan ( this s, ConsoleColor bg = null ) : ConsoleString

Changes the foreground of this string to dark cyan, and optionally forces the background of all characters to the given color.

ToDarkGray ( this s, ConsoleColor bg = null ) : ConsoleString

Changes the foreground of this string to dark gray, and optionally forces the background of all characters to the given color.

ToDarkGreen ( this s, ConsoleColor bg = null ) : ConsoleString

Changes the foreground of this string to dark green, and optionally forces the background of all characters to the given color.

ToDarkMagenta ( this s, ConsoleColor bg = null ) : ConsoleString

Changes the foreground of this string to dark magenta, and optionally forces the background of all characters to the given color.

ToDarkRed ( this s, ConsoleColor bg = null ) : ConsoleString

Changes the foreground of this string to dark red, and optionally forces the background of all characters to the given color.

ToDarkYellow ( this s, ConsoleColor bg = null ) : ConsoleString

Changes the foreground of this string to dark yellow, and optionally forces the background of all characters to the given color.

ToGray ( this s, ConsoleColor bg = null ) : ConsoleString

Changes the foreground of this string to gray, and optionally forces the background of all characters to the given color.

ToGreen ( this s, ConsoleColor bg = null ) : ConsoleString

Changes the foreground of this string to green, and optionally forces the background of all characters to the given color.

ToMagenta ( this s, ConsoleColor bg = null ) : ConsoleString

Changes the foreground of this string to magenta, and optionally forces the background of all characters to the given color.

ToRed ( this s, ConsoleColor bg = null ) : ConsoleString

Changes the foreground of this string to red, and optionally forces the background of all characters to the given color.

ToWhite ( this s, ConsoleColor bg = null ) : ConsoleString

Changes the foreground of this string to white, and optionally forces the background of all characters to the given color.

ToYellow ( this s, ConsoleColor bg = null ) : ConsoleString

Changes the foreground of this string to yellow, and optionally forces the background of all characters to the given color.

Method Details

ToBlack() public static method

Changes the foreground of this string to black, and optionally forces the background of all characters to the given color.
public static ToBlack ( this s, ConsoleColor bg = null ) : ConsoleString
s this the string to use to create the result
bg ConsoleColor The new background color for all characters or null to use the console's default
return ConsoleString

ToBlue() public static method

Changes the foreground of this string to blue, and optionally forces the background of all characters to the given color.
public static ToBlue ( this s, ConsoleColor bg = null ) : ConsoleString
s this the string to use to create the result
bg ConsoleColor The new background color for all characters or null to use the console's default
return ConsoleString

ToConsoleString() public static method

Converts a string to a ConsoleString
public static ToConsoleString ( this s, ConsoleColor fg = null, ConsoleColor bg = null ) : ConsoleString
s this the string to convert
fg ConsoleColor the foreground color to apply to the result
bg ConsoleColor the background color to apply to the result
return ConsoleString

ToCyan() public static method

Changes the foreground of this string to cyan, and optionally forces the background of all characters to the given color.
public static ToCyan ( this s, ConsoleColor bg = null ) : ConsoleString
s this the string to use to create the result
bg ConsoleColor The new background color for all characters or null to use the console's default
return ConsoleString

ToDarkBlue() public static method

Changes the foreground of this string to dark blue, and optionally forces the background of all characters to the given color.
public static ToDarkBlue ( this s, ConsoleColor bg = null ) : ConsoleString
s this the string to use to create the result
bg ConsoleColor The new background color for all characters or null to use the console's default
return ConsoleString

ToDarkCyan() public static method

Changes the foreground of this string to dark cyan, and optionally forces the background of all characters to the given color.
public static ToDarkCyan ( this s, ConsoleColor bg = null ) : ConsoleString
s this the string to use to create the result
bg ConsoleColor The new background color for all characters or null to use the console's default
return ConsoleString

ToDarkGray() public static method

Changes the foreground of this string to dark gray, and optionally forces the background of all characters to the given color.
public static ToDarkGray ( this s, ConsoleColor bg = null ) : ConsoleString
s this the string to use to create the result
bg ConsoleColor The new background color for all characters or null to use the console's default
return ConsoleString

ToDarkGreen() public static method

Changes the foreground of this string to dark green, and optionally forces the background of all characters to the given color.
public static ToDarkGreen ( this s, ConsoleColor bg = null ) : ConsoleString
s this the string to use to create the result
bg ConsoleColor The new background color for all characters or null to use the console's default
return ConsoleString

ToDarkMagenta() public static method

Changes the foreground of this string to dark magenta, and optionally forces the background of all characters to the given color.
public static ToDarkMagenta ( this s, ConsoleColor bg = null ) : ConsoleString
s this the string to use to create the result
bg ConsoleColor The new background color for all characters or null to use the console's default
return ConsoleString

ToDarkRed() public static method

Changes the foreground of this string to dark red, and optionally forces the background of all characters to the given color.
public static ToDarkRed ( this s, ConsoleColor bg = null ) : ConsoleString
s this the string to use to create the result
bg ConsoleColor The new background color for all characters or null to use the console's default
return ConsoleString

ToDarkYellow() public static method

Changes the foreground of this string to dark yellow, and optionally forces the background of all characters to the given color.
public static ToDarkYellow ( this s, ConsoleColor bg = null ) : ConsoleString
s this the string to use to create the result
bg ConsoleColor The new background color for all characters or null to use the console's default
return ConsoleString

ToGray() public static method

Changes the foreground of this string to gray, and optionally forces the background of all characters to the given color.
public static ToGray ( this s, ConsoleColor bg = null ) : ConsoleString
s this the string to use to create the result
bg ConsoleColor The new background color for all characters or null to use the console's default
return ConsoleString

ToGreen() public static method

Changes the foreground of this string to green, and optionally forces the background of all characters to the given color.
public static ToGreen ( this s, ConsoleColor bg = null ) : ConsoleString
s this the string to use to create the result
bg ConsoleColor The new background color for all characters or null to use the console's default
return ConsoleString

ToMagenta() public static method

Changes the foreground of this string to magenta, and optionally forces the background of all characters to the given color.
public static ToMagenta ( this s, ConsoleColor bg = null ) : ConsoleString
s this the string to use to create the result
bg ConsoleColor The new background color for all characters or null to use the console's default
return ConsoleString

ToRed() public static method

Changes the foreground of this string to red, and optionally forces the background of all characters to the given color.
public static ToRed ( this s, ConsoleColor bg = null ) : ConsoleString
s this the string to use to create the result
bg ConsoleColor The new background color for all characters or null to use the console's default
return ConsoleString

ToWhite() public static method

Changes the foreground of this string to white, and optionally forces the background of all characters to the given color.
public static ToWhite ( this s, ConsoleColor bg = null ) : ConsoleString
s this the string to use to create the result
bg ConsoleColor The new background color for all characters or null to use the console's default
return ConsoleString

ToYellow() public static method

Changes the foreground of this string to yellow, and optionally forces the background of all characters to the given color.
public static ToYellow ( this s, ConsoleColor bg = null ) : ConsoleString
s this the string to use to create the result
bg ConsoleColor The new background color for all characters or null to use the console's default
return ConsoleString