NagmaSidrahKhanam / PE4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PE5

  1. Write a java program to count the total number of occurrences of a given character in a ​ string without using any loop? For Example- Java is java again java again count number of occurrence of a in the given ​ string
  2. Write a program to replace all d with f and all l with t in the given ​ String Input: daily dry Output: faity fry Original ​ string​ : daily dry New ​ String​ : faity fry
  3. Write a program that ​ sets​ up a ​ String​ variable containing a paragraph of text of your choice. a. Extract the words from the text and sort them into alphabetical order. b. Display the sorted list of words.
  4. Write a program to transpose the given ​ string​ . Input ​ String​ : a quick brown fox jumps over the lazy dog Output ​ String​ : a kciuq nworb xof spmuj revo eht yzal god
  5. Write a program with the implementation of ​ Regular Expression​ to find the presence of the name Harry in a ​ string​ . Input: This is Harry. Output: Is Harry here ? true Input : This is Henry. Output: Is Harry here ? False
  6. Write a program to find out the multiple occurrences of the given word in a ​ string​ using Matcher methods. Input : She sells seashells by the seashore Given word: se Output : Found at: 4 - 6Found at: 10 - 12 Found at: 27 – 29

About


Languages

Language:Java 100.0%