how to get the first string in an array code example
Example 1: csharp first element of array
double[] values;
private List<double[]> valueList = new List<double[]>();
void AddNewValues(double d1, double d2, double d3)
{
values[0] = d1;
values[1] = d1;
values[2] = d1;
valueList.Add(values);
}
void GetAllFirstValues()
{
var test = valueList.Where(s => s == typeof(double[0]));
}
Example 2: Check first character of string in array and compare to another array
a = ['ghis', 'rs', 'ea','eat' ,'nentence']
let word = ''
function check(arr){
let color = ['green']
for(let i = 0; i < arr.length;i++){
word += arr[i][0]
}
for(let j = 0;j < color.length;j++){
if(word == color[j]){
return true
}
}
return false
}
console.log(check(a))