Sitecore 5.0 API

StringUtil.GetPostfix Method (String, Char, String)

Gets the postfix part of a string.

[Visual Basic]
Overloads Public Shared Function GetPostfix( _
   ByVal text As String, _
   ByVal delimiter As Char, _
   ByVal defaultValue As String _
) As String
[C#]
public static string GetPostfix(
   string text,
   char delimiter,
   string defaultValue
);

Parameters

text
A string
delimiter
The character delimiting the postfix from the rest of the string.
defaultValue
Value to return if delimiter is not found in text

Return Value

All characters of the string starting from character after the first occurrence of delimiter.

If delimiter is not found in the string, defaultValue is returned.

Example

  string postfix = StringUtil.GetPostfix("sc:menu", ':');
  MainUtil.Out(postfix);
Outputs: menu

See Also

StringUtil Class | Sitecore Namespace | StringUtil.GetPostfix Overload List | Right | Mid