StringExtensions.GetFirstCharacters Method

CSharp Extensions

StringExtensionsGetFirstCharacters Method
Retrieves first 'n' characters from a string.

Namespace: CSharpExtensions
Assembly: CSharpExtensions (in CSharpExtensions.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public static string GetFirstCharacters(
	this string input,
	int charsCount
)
<ExtensionAttribute>
Public Shared Function GetFirstCharacters ( 
	input As String,
	charsCount As Integer
) As String
public:
[ExtensionAttribute]
static String^ GetFirstCharacters(
	String^ input, 
	int charsCount
)
[<ExtensionAttribute>]
static member GetFirstCharacters : 
        input : string * 
        charsCount : int -> string 

Parameters

input
Type: SystemString
The source string.
charsCount
Type: SystemInt32
The number of characters to be returned.

Return Value

Type: String
Extracted characters sequence.

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