Answers for "substring 2"

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
0

substring 2

var str = "The MEAN stack is MongoDB, Express.js, AngularJS, and Node.js";
str.includes('MongoDB') //true
str.includes('Java') //false
str.includes('Node', 5) //true
Posted by: Guest on September-04-2021

Browse Popular Code Answers by Language