Daniel Horowitz 6 年之前
父節點
當前提交
3ecd9c4d61

+ 4
- 2
src/main/java/com/zipcodewilmington/danny_do_better_exercises/StringUtilities.java 查看文件

72
      * @return the first sequence of characters
72
      * @return the first sequence of characters
73
      */
73
      */
74
     public static String getFirstWord(String spaceDelimitedString){
74
     public static String getFirstWord(String spaceDelimitedString){
75
-        return null;
75
+
76
+        return spaceDelimitedString.split(" ")[0];
76
     }
77
     }
77
 
78
 
78
     /**
79
     /**
80
      * @return the second word of a string delimited by spaces.
81
      * @return the second word of a string delimited by spaces.
81
      */
82
      */
82
     public static String getSecondWord(String spaceDelimitedString){
83
     public static String getSecondWord(String spaceDelimitedString){
83
-        return null;
84
+
85
+        return spaceDelimitedString.split(" ")[1];
84
     }
86
     }
85
 
87
 
86
     /**
88
     /**

二進制
target/classes/com/zipcodewilmington/danny_do_better_exercises/StringUtilities.class 查看文件