BAEL-1171 java.lang.String API

This commit is contained in:
Ahmed Tawila 2017-10-15 12:38:54 +02:00
parent e2085cb4a6
commit 82fde89335
1 changed files with 8 additions and 1 deletions

View File

@ -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() {