Declaration
public static ConsoleColoredString ColorSubstring(
this string str,
int index,
int length,
ConsoleColor? foreground,
ConsoleColor? background = null
)
Summary
Colors the specified range within the specified string in a specified color.
Parameters
this string | str |
The string to partially colour. |
int | index |
The index at which to start colouring. |
int | length |
The number of characters to colour. |
ConsoleColor? | foreground |
The foreground color to assign to the range of characters. |
ConsoleColor? | background |
The background color to assign to the range of characters. |
Returns
A potentially colorful string.