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

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

The IndexOfValue method returns the position of a string in the list, where the second part of the string (after the separator specified in NVSeparator property) is the string specified in S parameter.  
The IgnoreCase parameter specifies whether the method should find the Value 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 second part of string after some separator ("value" part), in some particular position of the list — use Values property.  
iiwarning If the specified second part of string ("value" part) appears in the list more than once, IndexOfValue returns the position of the first occurrence.  

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