I want to make text appear in the following way:
H wait 0.1 seconds He wait 0.1 seconds Hel wait 0.1 seconds Hell wait 0.1 seconds Hello
But I\
String text = "Hello"; for(int i=1; i<=text.length();i++){ System.out.println(text.substring(0, i)); try { Thread.sleep(100); } catch (Exception e) { e.printStackTrace(); } }
Edit: if you want only 1 character by 1, than:
for(int i=0; i