Table of Contents

Class ContentHelper

Namespace
SharpConsoleUI.Helpers
Assembly
SharpConsoleUI.dll

Provides helper methods for content layout and positioning calculations.

public static class ContentHelper
Inheritance
ContentHelper
Inherited Members

Methods

GetCenter(int, int)

Calculates the starting position to center content within a given width.

public static int GetCenter(int availableWidth, int contentWidth)

Parameters

availableWidth int

The total available width for positioning.

contentWidth int

The width of the content to be centered.

Returns

int

The starting position (left offset) to center the content. Returns 0 if the content is wider than the available width.