Sitecore 5.0 API

StringUtil.Left Method 

Gets the leftmost part of a string.

[Visual Basic]
Public Shared Function Left( _
   ByVal text As String, _
   ByVal length As Integer _
) As String
[C#]
public static string Left(
   string text,
   int length
);

Parameters

text
A string
length
The number of character to return.

Return Value

The first length characters of the string.

Example

  string left = StringUtil.Left("Hello world", 5); // "Hello"

See Also

StringUtil Class | Sitecore Namespace | Right | Mid