I am looping through some text and need to compare text with text from another string to see if it matches anywhere in that string, and if it does, get the next character in the text, compare again, and if it is unique, store that as a separate variable. Here's what I have so far:
var sComplete = ""
for (i=2; i < 30; i ++) {
sPrefix = String(xlsSheet.Range("B" + i).substring(0,4));
if (sComplete.indexOf(sPrefix
) > 0) {
// get next character (so replace the fourth character with the fifth)
// compare that string against sComplete
}
sComplete += sPrefix + ", ";
}
Start Free Trial