Method LastIndexOf
LastIndexOf(StringBuilder, String)
Returns the last ordinal position of the start of searchValue
within searchValue
.
Declaration
public static int LastIndexOf(this StringBuilder builder, string searchValue)
Parameters
Type | Name | Description |
---|---|---|
System.Text.StringBuilder | builder | The string builder to search the contents of. |
System.String | searchValue | The string to search for. |
Returns
Type | Description |
---|---|
System.Int32 | Returns -1 if |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown if |
System.ArgumentException | Thrown if |
LastIndexOf(StringBuilder, String, Int32)
Returns the last ordinal position of the start of searchValue
within searchValue
.
Declaration
public static int LastIndexOf(this StringBuilder builder, string searchValue, int startIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Text.StringBuilder | builder | The string builder to search the contents of. |
System.String | searchValue | The string to search for. |
System.Int32 | startIndex | The first character position at which to start the search. |
Returns
Type | Description |
---|---|
System.Int32 | Returns -1 if |
Remarks
This method uses ordinal comparisions when searching for searchValue
.
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | Thrown if |
System.ArgumentNullException | Thrown if |
System.ArgumentException | Thrown if |