Skip to content

M_Ekstrand_Text_StringOperations_PadRightCrop

Fred Ekstrand edited this page Aug 4, 2020 · 1 revision

StringOperations.PadRightCrop Method

Left align text in a defined string column.

Namespace: Ekstrand.Text
Assembly: StringOperations (in StringOperations.dll) Version: 1.0.0.3 (1.0.0.3)

Syntax

C#

public static string PadRightCrop(
	this string str,
	int totalWidth,
	char paddingChar = ''
)

VB

<ExtensionAttribute>
Public Shared Function PadRightCrop ( 
	str As String,
	totalWidth As Integer,
	Optional paddingChar As Char = ""C
) As String

C++

public:
[ExtensionAttribute]
static String^ PadRightCrop(
	String^ str, 
	int totalWidth, 
	wchar_t paddingChar = L''
)

F#

[<ExtensionAttribute>]
static member PadRightCrop : 
        str : string * 
        totalWidth : int * 
        ?paddingChar : char 
(* Defaults:
        let _paddingChar = defaultArg paddingChar ''
*)
-> string 

Parameters

 

str
Type: System.String
String to be inserted into a defined sting column.
totalWidth
Type: System.Int32
Integer total width of the string column (length).
paddingChar (Optional)
Type: System.Char
Char character value used for padding. Default is space.

Return Value

Type: String
Returns a new string with given string left aligned to string column and any characters over the defined column width would be cropped.

Usage Note

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).

See Also

Reference

StringOperations Class
Ekstrand.Text Namespace

Clone this wiki locally