import java.io.FileReader;
public class TestFile {
public static void main(String[] args) {
try{
int i = 0;
String str = "";
FileReader fr = new FileReader("f://aaa.txt");
char[] ch = new char[1024];
while(fr.read(ch, 0, 1024) != -1){
str += new String(ch);
ch = new char[1024];
}
str += new String(ch);
while((i = str.lastIndexOf("我")) != -1){
System.out.println("我位于---" + i);
str = str.substring(0, i);
}
}catch(Exception e){
e.printStackTrace();
}
}
}