Q. Which method returns the string starting at the specified position?

  • (A) substr()
  • (B) getSubstring()
  • (C) slice()
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) substr()
Explanation: The substr() method returns the string starting at the specified position by the specified number of characters. Example:

var s = "Hello world!";
var res = str.substr(1, 3); //ell
Explanation by: Yogesh
The substr() method returns the string starting at the specified position by the specified number of characters. Example:

var s = "Hello world!";
var res = str.substr(1, 3); //ell

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
256
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Yogesh
Publisher
πŸ“ˆ
80%
Success Rate