Trending ▼   ResFinder  

ICSE Notes of all important string programs 2018 : Computer Applications (St. Francis School (SFS), Madhurawada, Visakhapatnam)

7 pages, 19 questions, 1 questions with responses, 1 total responses,    2    0
Deekshitha Alla
St. Francis School (SFS), Madhurawada, Visakhapatnam
7 to 10
+Fave Message
 Home > alladee3 >   F Also featured on: School Page rikhil32

Formatting page ...

//P1 to add a string to a character import java.io.*; public class stringPlusChar { void methods()throws IOException { InputStreamReader ir = new InputStreamReader(System.in);; BufferedReader br = new BufferedReader(ir); System.out.println("please enter a word"); String str = br.readLine(); char ch = str.charAt(3); System.out.println("werwerw"+ ch); } } //P2 to remove all the spaces in a sentence import java.io.*; //importing package public class RemoveSpaces // user defined data type { void method() throws IOException// exception handling { InputStreamReader ir = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(ir); System.out.println("please enter a sentance"); String str = br.readLine(); String str2 = str.replace(" ",""); System.out.println(str2); } } //P3 to print the consecutive repeated characters in a sentence import java.io.*; public class repeated { void method()throws IOException { String str1 = " "; InputStreamReader ir = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(ir); System.out.println("Please eneter a sentance"); String str = br.readLine(); str1 = str.replace(" ",""); int n = str1.length(); System.out.println("The repeated characters are"); for(int i=0; i<n-1; i++) { if(str1.charAt(i)==str1.charAt(i+1)) System.out.print(str1.charAt(i)+" "); } } } //P4 to count the small letters, capital letters and blank spaces import java.io.*; public class Charcount { int c,s,b; void method()throws IOException {

Formatting page ...

Top Contributors
to this ResPaper
(answers/comments)


ResPaper Admins

(1)

Ansh Anand

(1)

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

 

  Print intermediate debugging step

Show debugging info


 

 

© 2010 - 2024 ResPaper. Terms of ServiceContact Us Advertise with us

 

alladee3 chat