Skip to content

Commit 3284e7d

Browse files
committed
Java 11 test -- String.strip()
1 parent f81bf3b commit 3284e7d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sources/net.sf.j2s.java.core/src/test/Test_J8_Stream.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,15 @@ public static void main(String[] args) {
4040
String st = "test\ning\r\nnow";
4141
String[] lines = st.split("\n");
4242
int[] ptr = new int[1];
43+
long n = 0;
4344
if (/** @j2sNative true || */
4445
false) {
46+
String s = "\u0000test";
47+
assert (s.trim().length() == 4);
48+
n = (/** @j2sNative s.strip$().length || */0);
49+
System.out.println("strip gives length " + n);
50+
assert (n == 5);
51+
4552
// this is Java 11, so JavaScript-only test here
4653
Stream<String> o = /** @j2sNative st.lines$() || */
4754
null;
@@ -89,7 +96,6 @@ public void accept(String value) {
8996
Consumer<Integer> cc = param::set;
9097
Supplier<Integer> sup = param::get;
9198

92-
long n;
9399
StringBuffer sb = new StringBuffer("test");
94100
System.out.println("below is 'test'? " + sb);
95101
sb.chars().mapToObj(i -> (char) i).forEach(System.out::print);

0 commit comments

Comments
 (0)