about | help | code help+videos | done | prefs |
getSecondToLastLetter
public String getSecondToLastLetter(String s)
public String getSecondToLastLetter(String s) { int len = s.length(); String str = s.substring(len-2,len-1); return str; } getSecondToLastLetter("abcd") → "c" getSecondToLastLetter("1234") → "3" getSecondToLastLetter("Hollow") → "o" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 11
Copyright Nick Parlante 2017 - privacy