im trying to debug the following code, and i have breaked at line w= w+ inputString.substring(firsti,i)+"yay"; but debugger shows blank (source not found) what’s going on?
public String translate (String inputString)
{
String w = "";
int firsti =0;
for(int i=0; i< inputString.length(); i++){
if(isVowel(inputString.charAt(i))){
firsti = i;
while (inputString.charAt(i) != ' ' || i< inputString.length()){
i++;
}
w= w+ inputString.substring(firsti,i)+"yay";
System.out.println(w);
}
}
String outputString = new String(inputString); // Copies input to output and prints it.
return outputString;
}
You might be trying to get into
substring()method which is inside java API. You need to attach Java source to debugsubstring()How to attach source:
Go to Project > Properties > Java Build Path > Libraries and expand JRE System Library JRE Version then, rt.jar. Select Source attachment, click Edit…. Select the source code file (External File…) and press OK
Read this link for more info.