From 82fde89335c1abe44cb65e7625bbdb8ca4f8c629 Mon Sep 17 00:00:00 2001 From: Ahmed Tawila Date: Sun, 15 Oct 2017 12:38:54 +0200 Subject: [PATCH] BAEL-1171 java.lang.String API --- .../src/test/java/com/baeldung/string/StringTest.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core-java/src/test/java/com/baeldung/string/StringTest.java b/core-java/src/test/java/com/baeldung/string/StringTest.java index 324f4690fc..5bb4de27ee 100644 --- a/core-java/src/test/java/com/baeldung/string/StringTest.java +++ b/core-java/src/test/java/com/baeldung/string/StringTest.java @@ -38,7 +38,7 @@ public class StringTest { } @Test - public void whenGetBytesUsingUTF16_thenCorrect() { + public void whenGetBytesUsingASCII_thenCorrect() { byte[] byteArray = "efgh".getBytes(StandardCharsets.US_ASCII); byte[] expected = new byte[] { 101, 102, 103, 104 }; @@ -155,6 +155,13 @@ public class StringTest { String[] result = s.split("*"); } + + @Test + public void whenCallSubSequence_thenCorrect() { + String s = "Welcome to Baeldung"; + + assertEquals("Welcome", s.subSequence(0, 7)); + } @Test public void whenCallSubstring_thenCorrect() {