Computer Applications
Which of the following functions is used to remove leading and trailing white spaces from the string?
- trim( )
- trail( )
- truncate( )
- slice( )
Related Questions
If a string contains 12 characters, what will be the index of the last character?
- 12
- 11
- 10
- 0
What will be the value stored in the variable 'c' if the following statement is executed?
c = "COMPUTER".charAt("COMPUTER ".indexOf('P'))- 3
- 4
- P
- M
What will be the output of the following program snippet?
s1 = "COMPUTER";
s2 = "computer";
System.out.println(s1.equals(s2));- True
- False
- 0
- 1
What will be the output of the following program snippet?
str1 = "AMAN";
str2 = "AMIT";
System.out.println(str1.compareTo(str2));- 8
- 0
- -8
- 2