InterviewSolution
Saved Bookmarks
| 1. |
What does function length do in String class?(a) Returns length of string including null character(b) Returns length of string excluding null character(c) Returns length of substring(d) Returns size of string in bytes |
|
Answer» The correct answer is (b) Returns length of string excluding null character Best explanation: The length function returns the length of string. The length is the number of characters in the string but the last null character is not counted. The string length can be used to loop through each character in the string. |
|