stringlistcontainer IndexOfName method
Return to Introduction  Previous page  Next page
Applies to
acStringListContainer component.  

function IndexOfName(const S: String; IgnoreCase: Boolean = True): Integer;  

The IndexOfName method returns the position of a string in the list, where the first part of the string (before the separator specified in NVSeparator property) is the string specified in S parameter.  
The IgnoreCase parameter specifies whether the method should find the Name by specified string ignoring the case of characters (without case sensitivety, so it will find the string independently of whether you specified "sTrInG" or "String" or S parameter). However, you should set IgnoreCase parameter to False, if the case of character is essential.  
tip To retreive or modify the first part of string before some separator ("name" part), in some particular position of the list — use Names property.  
iiwarning If the specified first part of string ("name" part) appears in the list more than once, IndexOfName returns the position of the first occurrence.  

See also
IndexOf and IndexOfValue methods;  
Strings, Names, Values, MaxSize, Count and NVSeparator properties.