C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,285 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello Friends I was wondering if I have a string of values held in a variable of type string called strValues . e.g. string strValues ="COY,RAY,REX"; The passed in variable that references the value is RAY can I use this variable to find out if one of the values is in the 0th index of a value like so if(strValues.indexOf(value)==0). Do I need to use an array? I just want to keep my code as Terse as possible. Thanks for any help.
or just:
var strValues = "COY,RAY,REX".Split(',');
if(Array.IndexOf(strValues, value) == 0)