UtilStringDrawTextBox Method
Draws a box around the specified text, that is, a text-box.
Namespace: DevCase.Core.DataProcessing.CommonAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static string DrawTextBox(
string input,
int verticalPadding = 0,
int horizontalPadding = 0,
char fillChar = '',
BoxDrawingStyle drawingStyle = default
)
Public Shared Function DrawTextBox (
input As String,
Optional verticalPadding As Integer = 0,
Optional horizontalPadding As Integer = 0,
Optional fillChar As Char = ""C,
Optional drawingStyle As BoxDrawingStyle = Nothing
) As String
Dim input As String
Dim verticalPadding As Integer
Dim horizontalPadding As Integer
Dim fillChar As Char
Dim drawingStyle As BoxDrawingStyle
Dim returnValue As String
returnValue = UtilString.DrawTextBox(input,
verticalPadding, horizontalPadding,
fillChar, drawingStyle)
public:
static String^ DrawTextBox(
String^ input,
int verticalPadding = 0,
int horizontalPadding = 0,
wchar_t fillChar = L'',
BoxDrawingStyle drawingStyle = BoxDrawingStyle()
)
static member DrawTextBox :
input : string *
?verticalPadding : int *
?horizontalPadding : int *
?fillChar : char *
?drawingStyle : BoxDrawingStyle
(* Defaults:
let _verticalPadding = defaultArg verticalPadding 0
let _horizontalPadding = defaultArg horizontalPadding 0
let _fillChar = defaultArg fillChar ''
let _drawingStyle = defaultArg drawingStyle new BoxDrawingStyle()
*)
-> string
No code example is currently available or this language may not be supported.
- input String
-
The input text to be boxed.
- verticalPadding Int32 (Optional)
-
Optional. The number of vertical padding lines. Default value is: '0'.
- horizontalPadding Int32 (Optional)
-
Optional. The number of horizontal padding characters. Default value is: '0'.
- fillChar Char (Optional)
-
Optional. The character used to fill the empty space in the box. Default value is: " " (white-space).
- drawingStyle BoxDrawingStyle (Optional)
-
Optional. The style of the box drawing. If not specified, a default style will be used.
If this value is null, "-" character is used for vertical sides,
"|" for horizontal sides and "+" for all corners.
Default value is: null.
String
The resulting string containing the text enclosed in the box.
This is a code example.
No code example is currently available or this language may not be supported.
Dim input As String = "Push this button!"
Dim verticalPadding As Integer = 1
Dim horizontalPadding As Integer = 2
Dim fillChar As Char = "█"c
Dim drawingStyle As New BoxDrawingStyle With {
.Top = "═"c, .Bottom = "═"c,
.Left = "║"c, .Right = "║"c,
.TopLeft = "╔"c,
.TopRight = "╗"c,
.BottomLeft = "╚"c,
.BottomRight = "╝"c
}
Dim result As String = DrawTextBox(input, verticalPadding, horizontalPadding, fillChar, drawingStyle)
Console.WriteLine(result)
IO.File.WriteAllText("\box.txt", result, Encoding.Unicode)
' Output:
' ╔═════════════════════╗
' ║█████████████████████║
' ║██Push this button!██║
' ║█████████████████████║
' ╚═════════════════════╝
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.