In processing.js i used the following code to find a character position within the string scale:
for (i=0; i<EOS; i++)
if (scale.charCodeAt(i)==key) return i;
How can I do this in p5.js? I tried with match() but don't know the syntax.