is there any direct way to get the index of array? something like indexof for String class.