瀏覽代碼

Kinda done

Akeem Cherry 6 年之前
父節點
當前提交
a5e593011e
共有 1 個檔案被更改,包括 4 行新增9 行删除
  1. 4
    9
      src/main/java/rocks/zipcode/io/quiz3/arrays/WaveGenerator.java

+ 4
- 9
src/main/java/rocks/zipcode/io/quiz3/arrays/WaveGenerator.java 查看文件

@@ -5,15 +5,10 @@ package rocks.zipcode.io.quiz3.arrays;
5 5
  */
6 6
 public class WaveGenerator {
7 7
     public static String[] wave(String str) {
8
-        char[] arr = str.toCharArray();
9
-        Integer counter = 0;
10
-        for(int i=0;i < str.length(); i++) {
11
-            for (int j = 0; j <= i; j++) {
12
-                counter++;
13
-                if(j < i){
14
-                    System.out.println(arr);
15
-                }
16
-            }
8
+        String spaces = "";
9
+        for(int i = 0; i < str.length(); i++){
10
+            System.out.println(str.toLowerCase().substring(0,i) + str.charAt(i) + str.toLowerCase().substring(i+1, str.length()-1));
11
+//            spaces += " ";
17 12
         }
18 13
         return null;
19 14
     }