I'm trying to split an input string into an array of substrings and currently trying something like this...
public static void tryp(String inputString){
int index = 0;
String[] rArray = new String[1000];
String[] kArray = new String[1000];
int startPos = 0;
int x;
int newRPos = 0;
int newKPos = 0;
String protString;
while (newRPos != -1){
for (x = 0; x < inputString.length(); x++){
int ind = 0;
newRPos = inputString.indexOf('R');
String nextRPep = inputString.substring(startPos, (newRPos+1));
protString = inputString.substring(newRPos+1, inputString.length());
rArray[ind] = nextRPep;
ind++;
startPos = newRPos+1;
newRPos = protString.indexOf('R');
rArray[ind+1] = protString;
}
for (index = 0; index < rArray.length; index++){
newKPos = inputString.indexOf('K');
while (newKPos != -1){
for (x = 0; x < rArray.length; x++){
int ind = 0;
String rPep = rArray[x];
String nextPep = rPep.substring(startPos, (newKPos+1));
protString = rPep.substring(newKPos+1, rPep.length());
kArray[ind] = nextPep;
ind++;
startPos = newKPos+1;
newKPos = protString.indexOf('K');
kArray[ind+1] = protString;
}
}
}
}
This compiles but doesn't do what I want....?
Any help much appreciated as I can't think what else I can try (have tried lots that didn't help!)
Thanks