Is there any inbuilt function in ballerina to check if a value exists in an array?
I tried a simple function which iterate through a string array and checking the whether the value is present.
function isContain(string[] array1,string id) returns (boolean) {
int i=0;
int checker=-0;
while (i<lengthof (array1)) {
if(array1[i]==id){
checker = 1;
break;
}
i++;
}
if (checker == 1){
return true;
}
else{
return false;
}
}