Write the name of functions which : (i) returns length of a string (ii) returns specified number of character from a string.
Answers
Answered by
1
(i) length()
For ex- String a="Sunny Leone";
int l= a.length();
Output :- 11 (it also count space )
(ii) substring() // it does not include upper index bound
i-for ex- String t="Aftab Ahmed Ansari";
String b= t.substring(0,3);
Output :- Aft
ii- String t="Raftaar Is the Best" ,k;
k=t.substring(9);
Ouptut :- s the Best
Hope it will help
mark me brainlest @
Similar questions
Computer Science,
1 year ago
Math,
1 year ago