Declaration
public static ConsoleColoredString ColorSubstring(
this string str,
int index,
ConsoleColor? foreground,
ConsoleColor? background = null
)
Summary
Colors a range of characters beginning at a specified index 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. |
ConsoleColor? | foreground |
The colour to assign to the characters starting from the character at index. |
ConsoleColor? | background |
The background color to assign to the range of characters. |
Returns
A potentially colorful string.