Q. Which method reference would replace `str -> str.trim()`?

  • (A) String::toUpperCase
  • (B) String::trim
  • (C) String::substring
  • (D) String::isEmpty
πŸ’¬ Discuss
βœ… Correct Answer: (B) String::trim
Explanation: `String::trim` is used to remove leading and trailing spaces.
Explanation by: Mr. Dubey
`String::trim` is used to remove leading and trailing spaces.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
57
Total Visits
πŸ“½οΈ
12 mo ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
92%
Success Rate