Skip to content

Commit 47713cc

Browse files
authored
Create nonStart.java
Given 2 strings, return their concatenation, except omit the first char of each. The strings will be at least length 1. nonStart("Hello", "There") → "ellohere" nonStart("java", "code") → "avaode" nonStart("shotl", "java") → "hotlava"
1 parent b7d17b8 commit 47713cc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

String-1/nonStart.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
Given 2 strings, return their concatenation, except omit the first char of each. The strings will be at least length 1.
3+
4+
nonStart("Hello", "There") → "ellohere"
5+
nonStart("java", "code") → "avaode"
6+
nonStart("shotl", "java") → "hotlava"
7+
8+
*/
9+
public String nonStart(String a, String b) {
10+
return a.substring(1) + b.substring(1);
11+
}

0 commit comments

Comments
 (0)