-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathWithoutEnd.java
More file actions
25 lines (22 loc) · 673 Bytes
/
WithoutEnd.java
File metadata and controls
25 lines (22 loc) · 673 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.codefortomorrow.beginner.chapter3.practice;
/*
* Adapted from withoutEnd (CodingBat)
* https://codingbat.com/prob/p130896
*
* Given 3 strings that are at least 2
* characters long, print each string
* without its first and last character.
*
* Hint: Use the length() method on
* a string to get the number of
* characters that make up that string.
*/
public class WithoutEnd {
@SuppressWarnings("unused")
public static void main(String[] args) {
String str1 = "Hello"; // should print "ell"
String str2 = "java"; // should print "av"
String str3 = "coding"; // should print "odin"
// write code here
}
}