I have this code:
/*
package lab;
public class Main {
public static void main(String[] args) {
int t=0;
int h=0;
int w=0;
String Name="http://hcmiu.edu.vn/mail/cuem";
char[] ch=new char[Name.length()];
for(int i=0;i<Name.length();i++){
ch[i]=Name.charAt(i);
for(int j=0;j<Name.length();j++){
if((ch[j]=='/')&&(ch[j+1]=='/')&&(Character.isLetter(ch[j+2]))){
t=j+2;
System.out.println(t);
h=Name.indexOf('/', j+3);
}
}
}
System.out.println(Name.subSequence(t, h));
}
}
This code run correctly.But when i dont use the second for loop.i couldnt work.I dont know? plz give me the answer.
/*
package lab;
public class Main {
public static void main(String[] args) {
int t=0;
int h=0;
int w=0;
String Name="http://hcmiu.edu.vn/mail/cuem";
char[] ch=new char[Name.length()];
for(int i=0;i<Name.length();i++){
ch[i]=Name.charAt(i);
if((ch[i]=='/')&&(ch[i+1]=='/')&&(Character.isLetter(ch[i+2]))){
t=o+2;
System.out.println(t);
h=Name.indexOf('/', j+3);
}
}
System.out.println(Name.subSequence(t, h));
}
}
Why do i need the second for loop?