File tree Expand file tree Collapse file tree
src/main/java/io/github/biezhi/java11/string Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 <plugin >
2222 <groupId >org.apache.maven.plugins</groupId >
2323 <artifactId >maven-compiler-plugin</artifactId >
24- <version >3.7 .0</version >
24+ <version >3.8 .0</version >
2525 <configuration >
26- <source >11</source >
27- <target >11</target >
28- <compilerArgument >--add-modules=jdk.incubator.httpclient</compilerArgument >
26+ <release >11</release >
2927 </configuration >
3028 </plugin >
3129 <plugin >
Original file line number Diff line number Diff line change 11package io .github .biezhi .java11 .string ;
22
3+ import java .util .stream .Collectors ;
4+
35/**
46 * String.repeat(int)
57 * String.lines()
@@ -90,13 +92,23 @@ public static void demonstrateStringIsBlank() {
9092 System .out .println ("空格 -> " + spacesOnly .isBlank ());
9193 }
9294
95+
96+ public static void lines () {
97+ writeHeader ("String.lines()" );
98+
99+ String str = "Hello \n World, I,m\n biezhi." ;
100+
101+ System .out .println (str .lines ().collect (Collectors .toList ()));
102+ }
103+
93104 public static void main (String [] args ) {
94105// writeHeader("User-Agent\tMozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5)");
95106// demonstrateStringLines();
96107// demonstrateStringStrip();
97108// demonstrateStringStripLeading();
98109// demonstrateStringStripTrailing();
99- demonstrateStringIsBlank ();
110+ // demonstrateStringIsBlank();
111+ lines ();
100112 }
101113
102114}
You can’t perform that action at this time.
0 commit comments