Skip to content

mritunjayr/java-projectexercise-4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Java Language Basics - Practice Exercise 4

  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 - 6
     Found at: 10 - 12
     Found at: 27 – 29
    

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages