Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  


Shop
Java All : String Class Functions


Solved Problems
Output writing – indexOf, substring #7241 

Write the output for the following:
String s=”Today is Test” ;
System.out.println(s.indexOf(‘T’));
System.out.println(s.substring(0,7) + ” ” +”Holiday”);

Write the output for the following: String s="Today is Test" ; System.out.println(s.inde ...
String class methods to separate file path, name and extension #7428 

Write a program to assign a full path and file name as given below. Using library functions, extract and output the file path, file name and
file extension separately as shown.
Input C:\Users\admin\Pictures\flower.jpg
Output Path: C:\Users\admin\Pictures\
File name: flower
Extension: jpg

Write a program to assign a full path and file name as given below. Using library function ...
Exam Questions
ICSE2015-02C  Using Math.pow and indexOf #3964 

What is the value stored in variable res given below:
double res = Math.pow(“345”.indexOf(‘5’), 3);

What is the value stored in variable res given below: double res = Math.pow("345".indexOf ...
ICSE2015-03C  Use of substring, toUpperCase and equalsIgnoreCase() #3980 

State the output of the following  program segment is executed :

String a = "Smartphone", b = "Graphic Art";
String h = a.substring(2, 5);
String k = b.substring(8).toUpperCase();
System.out.println(h);
System.out.println(k.equalsIgnoreCase(h));
State the output of the following  program segment is executed :
String a = "Smartp ...		
ICSE2015-03E  Identifying functions by description #3984 

(i) Name the mathematical function which is used to find sine of an angle given in radians
(ii) Name a string function which removes the blank spaces provided in the prefix and suffix of a string

(i) Name the mathematical function which is used to find sine of an angle given in radians ...
ICSE2018-03G  replace() compareTo() #4063 

Give the output of the following string functions:
(i) “ACHIEVEMENT”.replace(‘E’,’A’)
(ii)”DEDICATE”.compareTo(“DEVOTE”)

Give the output of the following string functions: (i) "ACHIEVEMENT".replace('E','A') (i ...
ICSE2018-03H  array.length() and substring() #4065 

Consider the following String array and give the output
String arr[]= {“DELHI”, “CHENNAI”, “MUMBAI”, “LUCKNOW”, “JAIPUR”};
System.out.println(arr[0].length()>arr[3].length());
System.out.print(arr[4].substring(0,3));

Consider the following String array and give the output String arr[]= {"DELHI", "CHENNAI" ...
ICSE2016-03A  indexOf lastIndexOf compareTo #4235 

Give the output of the following string functions :
(i) “MISSISSIPPI”.indexOf(‘S’) + “MISSISSIPPI”.lastIndexOf(‘I’)
(ii) “CABLE”.compareTo(“CADET”)

Give the output of the following string functions : (i) “MISSISSIPPI”.indexOf(‘S’ ...
ICSE2018-06A  Sentence to Title Case Conversion #7192 

Write a program in Java to accept a string in lower case and change the first letter of every word to upper case. Display the new string.
Sample input: we are in cyber world
Sample output: We Are In Cyber World

Write a program in Java to accept a string in lower case and change the first letter of ev ...
ICSE2017-03F  Output writing – indexOf, substring #7241 

Write the output for the following:
String s=”Today is Test” ;
System.out.println(s.indexOf(‘T’));
System.out.println(s.substring(0,7) + ” ” +”Holiday”);

Write the output for the following: String s="Today is Test" ; System.out.println(s.inde ...
ICSE2014-06A  String class methods to separate file path, name and extension #7428 

Write a program to assign a full path and file name as given below. Using library functions, extract and output the file path, file name and
file extension separately as shown.
Input C:\Users\admin\Pictures\flower.jpg
Output Path: C:\Users\admin\Pictures\
File name: flower
Extension: jpg

Write a program to assign a full path and file name as given below. Using library function ...

Solved Problems:2  Exam Questions:12 
Back