String Manipulation With Substring
Consider the following method.
public static String scramble(String word, int howFar)
{
return word.substring(howFar + 1, word.length()) +
word.substring(0, howFar);
}
What value is returned by the call scramble("compiler", 3)?
A
“compiler”
B
“ilercomp”
C
“ilercom”
D
“pilercom”
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | hiboyshello | 1 | 1 | 0m 00s | 100 |
| #2 | varunrajaram1 | 1 | 1 | 0m 00s | 100 |
| #3 | ragulk14122006 | 1 | 1 | 0m 23s | 77 |
| #4 | y.seong2027 | 1 | 1 | 1m 02s | 38 |
| #5 | bommasam000 | 1 | 1 | 1m 17s | 23 |
| #6 | kazvin.tjakradinata | 1 | 2 | 1m 14s | 16 |
| #7 | hyeokjinlee0924 | 1 | 2 | 1m 28s | 2 |
| #8 | alchemax043 | 1 | 1 | 1m 38s | 2 |
| #9 | lsj08030922 | 1 | 2 | 1m 35s | -5 |
| #10 | angelajxi11 | 0 | 1 | 0m 00s | -10 |
Items per page:
10
1 – 10 of 23
