StringExtensionsPadBoth Method
Returns a new string that center-aligns the characters in the source string by
padding them on the left and the right with a specified Unicode character,
for a specified total length.
Namespace: DevCase.Extensions.StringExtensionsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[EditorBrowsableAttribute(EditorBrowsableState.Always)]
public static string PadBoth(
this string str,
int width,
char paddingChar
)
<ExtensionAttribute>
<EditorBrowsableAttribute(EditorBrowsableState.Always)>
Public Shared Function PadBoth (
str As String,
width As Integer,
paddingChar As Char
) As String
Dim str As String
Dim width As Integer
Dim paddingChar As Char
Dim returnValue As String
returnValue = str.PadBoth(width, paddingChar)
public:
[ExtensionAttribute]
[EditorBrowsableAttribute(EditorBrowsableState::Always)]
static String^ PadBoth(
String^ str,
int width,
wchar_t paddingChar
)
[<ExtensionAttribute>]
[<EditorBrowsableAttribute(EditorBrowsableState.Always)>]
static member PadBoth :
str : string *
width : int *
paddingChar : char -> string
No code example is currently available or this language may not be supported.
- str String
-
The source String.
- width Int32
-
The number of characters in the resulting string,
equal to the number of original characters plus any additional padding characters.
- paddingChar Char
-
A Unicode padding character.
String
The resulting
String.
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).
This is a code example.
No code example is currently available or this language may not be supported.
Dim str As String = "1234".PadBoth(8, "x"c)
MessageBox.Show(str)
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.