ICSE Class 10 Computer Applications
Question 26 of 30
Solved 2024 Specimen Paper ICSE Class 10 Computer Applications — Question 26
Back to all questions(a)
3
indexOf() returns the index of the first occurrence of the specified character within the string or -1 if the character is not present. First occurrence of 'I' in "ARTIFICIAL" is at index 3 (a string begins at index 0).
(b)
13
trim() removes all leading and trailing space from the string and length() returns the length of the string i.e., the number of characters present in the string. Thus, the output is 13.