-
Notifications
You must be signed in to change notification settings - Fork 0
M_Ekstrand_Text_StringOperations_PadCenter
Fred Ekstrand edited this page Aug 4, 2020
·
1 revision
Center align text in a defined string column.
Namespace: Ekstrand.Text
Assembly: StringOperations (in StringOperations.dll) Version: 1.0.0.3 (1.0.0.3)
C#
public static string PadCenter(
this string str,
int totalWidth,
char paddingChar = ''
)VB
<ExtensionAttribute>
Public Shared Function PadCenter (
str As String,
totalWidth As Integer,
Optional paddingChar As Char = ""C
) As StringC++
public:
[ExtensionAttribute]
static String^ PadCenter(
String^ str,
int totalWidth,
wchar_t paddingChar = L''
)F#
[<ExtensionAttribute>]
static member PadCenter :
str : string *
totalWidth : int *
?paddingChar : char
(* Defaults:
let _paddingChar = defaultArg paddingChar ''
*)
-> string
- str
- Type: System.String
String to be centered in string column. - totalWidth
- Type: System.Int32
Integer total width of the string column (length) to place a string in. - paddingChar (Optional)
- Type: System.Char
Char padding character default is space.
Type: String
Return a string centered in defined length.
In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
If given string is larger than given string column length the given string is returned.
Copyright © 2019 Fred Ekstrand Jr
Send comments on this topic to fredekstrandGithub@gmail.com
Created using: Sandcastle Help File Builder
-
Ekstrand.Text Namespace
-
StringOperations Class
-
StringOperations Methods
- StringOperations.EscapeIllegalChars Method
- StringOperations.FirstCharToLowercase Method
- StringOperations.FirstCharToUppercase Method
- StringOperations.PadCenter Method
- StringOperations.PadCenterCrop Method
- StringOperations.PadLeftCrop Method
- StringOperations.PadRightCrop Method
- StringOperations.Remove Method
- StringOperations.Replace Method
- StringOperations.ToTitleCase Method
-
StringOperations Methods
- StringUtil Class
-
StringOperations Class