Share via


IndexOf Method

Returns the index of the Promocode string with the specified identifier.

Namespace:  Microsoft.CommerceServer.Runtime.Orders
Assembly:  Microsoft.CommerceServer.Runtime (in Microsoft.CommerceServer.Runtime.dll)

Syntax

'Declaration
Public Function IndexOf ( _
    promotionCode As String _
) As Integer
'Usage
Dim instance As PromoCodeStringCollection
Dim promotionCode As String
Dim returnValue As Integer

returnValue = instance.IndexOf(promotionCode)
public int IndexOf(
    string promotionCode
)
public:
int IndexOf(
    String^ promotionCode
)
public function IndexOf(
    promotionCode : String
) : int

Parameters

  • promotionCode
    Type: System..::.String
    The Promocode string for which to find the index. Cannot be nullNothingnullptra null reference (Nothing in Visual Basic).

Return Value

Type: System..::.Int32
The zero based index of the Promocode string, specified by the identifier. The index of the entry, or -1 if not found.

Exceptions

Exception Condition
ArgumentNullException

The Promocode string is nullNothingnullptra null reference (Nothing in Visual Basic).

Remarks

Searches for the specified PromoCode string and returns the zero-based index of the first occurrence within the entire PromoCodeStringCollection. Returns -1 if the specified object is not found.

Permissions

See Also

Reference

PromoCodeStringCollection Class

PromoCodeStringCollection Members

Microsoft.CommerceServer.Runtime.Orders Namespace