Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Write a description of class ExerciseEighteen here.
- * Kailey McNeal
- * 10-2-14
- * #18 pg 191
- */
- public class ExerciseEighteen
- {
- public static void main(String[]args)
- {
- vertical("hey now");
- }
- public static void vertical(String word)
- {
- int length=word.length(); //length of string
- for (int i=0; i<=length; i++)
- {
- if(i+1>length)
- {
- System.out.println(word.substring(i));
- }
- else
- {
- System.out.println(word.substring(i, i+1));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement