Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Method: ConsoleColoredString ColorSubstring(int, int, ConsoleColor?, ConsoleColor?)

Declaration

public ConsoleColoredString ColorSubstring(
    int index,
    int length,
    ConsoleColor? foreground,
    ConsoleColor? background
)

Summary

Colors the specified range within the current string in the specified colors.

Parameters

intindex The index at which to start coloring.
intlength The number of characters to color.
ConsoleColor?foreground The foreground color to assign to the range of characters, or null to use the console’s default foreground color.
ConsoleColor?background The background color to assign to the range of characters, or null to use the console’s default background color.

Returns

The current string but with some of the colors changed.