Sitecore 5.1.1 API

MainUtil.RemoveEnd Method 

Removes a number of characters from the end of a string.

[Visual Basic]
Public Shared Function RemoveEnd( _
   ByVal s As String, _
   ByVal count As Integer _
) As String
[C#]
public static string RemoveEnd(
   string s,
   int count
);

Parameters

s
A string.
count
The number of characters to remove.

Return Value

The first characters of the string.

Remarks

If count is greater than the length of the string, blank is returned.

Example

  string text = "Hello world";
  string s0 = MainUtil.RemoveEnd(text, 6); // "Hello"

See Also

MainUtil Class | Sitecore Namespace | RemoveStart