Answers for "js substring from righy"

7

javascript get last n characters of string

'abc'.slice(-1); // c
Posted by: Guest on February-03-2020
0

str.substring if 2 letters

public String firstTwo(String str) {
    return str.length() < 2 ? str : str.substring(0, 2);
}
Posted by: Guest on September-19-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language