Method AfterLast
AfterLast(String, String)
Returns the portion of value that occurs after the last occurrence of searchValue.
Declaration
public static string AfterLast(this string value, string searchValue)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value | The value to search within. |
| System.String | searchValue | The value to search for. |
Returns
| Type | Description |
|---|---|
| System.String | Either null, or a new string containing the portion of the string after the last occurrence of |
Remarks
Returns null if searchValue is null, empty string, searchValue does not occur within value or it occurs at the very end.
Matching of searchValue is done using a System.StringComparison.Ordinal comparison.
AfterLast(String, String, StringComparison)
Returns the portion of value that occurs after the last occurrence of searchValue.
Declaration
public static string AfterLast(this string value, string searchValue, StringComparison comparisonMethod)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value | The value to search within. |
| System.String | searchValue | The value to search for. |
| System.StringComparison | comparisonMethod | The System.StringComparison method to use when searching for |
Returns
| Type | Description |
|---|---|
| System.String | Either null, or a new string containing the portion of the string after the last occurrence of |
Remarks
Returns null if searchValue is null, empty string, searchValue does not occur within value or it occurs at the very end.