Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Static class: RT.Util.ExtensionMethods.ConsoleExtensions

Summary

Console-related extension methods.

Static methods

ConsoleColoredString
Color(this string str, ConsoleColor? foreground, ConsoleColor? background = null)
Colors the specified string in the specified console color.
ConsoleColoredChar
Color(this char ch, ConsoleColor? foreground, ConsoleColor? background = null)
Colors the specified character in the specified console color.
ConsoleColoredString
ColorSubstring(this string str, int index, ConsoleColor? foreground, ConsoleColor? background = null)
Colors a range of characters beginning at a specified index within the specified string in a specified color.
ConsoleColoredString
ColorSubstring(this string str, int index, int length, ConsoleColor? foreground, ConsoleColor? background = null)
Colors the specified range within the specified string in a specified color.
string
Fmt(this string formatString, params object[] args)
Formats a string in a way compatible with string.Format(string, object[]).
string
Fmt(this string formatString, IFormatProvider provider, params object[] args)
IEnumerable<object>
FmtEnumerable(this string formatString, params object[] args)
Formats the specified objects into the format string. The result is an enumerable collection which enumerates parts of the format string interspersed with the arguments as appropriate.
IEnumerable<object>
FmtEnumerable(this string formatString, IFormatProvider provider, params object[] args)
ConsoleColoredString
JoinColoredString<T>(this IEnumerable<T> values, ConsoleColoredString separator = null, ConsoleColoredString prefix = null, ConsoleColoredString suffix = null, ConsoleColor defaultColor = Gray)
Equivalent to IEnumerableExtensions.JoinString<T>(this IEnumerable<T>, string, string, string, string), but for ConsoleColoredStrings.
ConsoleColoredString
ToConsoleColoredString(this object obj, ConsoleColor? defaultForeground = null, ConsoleColor? defaultBackground = null)
Returns the specified object as a colored string.
IEnumerable<ConsoleColoredString>
WordWrap(this ConsoleColoredString text, int maxWidth, int hangingIndent = 0)
Word-wraps the current ConsoleColoredString to a specified width. Supports UNIX-style newlines and indented paragraphs. (see also remarks)