I am trying to find which string is nearest to another string in an array of numbers and strings. For example, say I have an array that is as follows
testarray={0,0,0,"apple",0,0,0,"pear",0,0,0,0,0,"pineapple"}
I want a general way to find that "apple" is nearest to "pear". Is there an efficient way to do this?
Thanks!