Skip to content

voyager2005/string-manipulation

Repository files navigation

basic-java-string-programs

Hello There👋:

This Repository contains a few string related java programs... If you have downloaded and liked the programs in this repository then please do ⭐ this repo...
Feel free to contact me on my g-mail

Key:

WHO IS THE INVENTOR OF JAVA
WordCount
capitalize
change_case
cocat_ThreeWords
count-letter-frequency
increment-vowels
longestWord
pigalitin
reverse

License and copyright:

This repository is Licensed under MIT License

Programs and their execution:

This is the explaination of every program:

WHO IS THE INVENTOR OF JAVA:

In this program the user is requested to enter the name of the inventor of java. <br/ >If the user enters James Gosling then the the program is terminated with a congrats message. else the user is given another chance to enter to name.
If the user is unable to answer after 3 attempts then the answer is displayed and the program is terminated.

WordCount:

The program accepts a string from the user and also a key from the user which is nothing but the word that the user wants to find in entered string.
Later the program counts the number of times key is occuring in the string and displays the frequency.

capitalize:

This program accepts a string from the user say:

mohandas karamchand gandhi

Later this program converts this string into the correct naming for:

Mohandas Karamchand Gandhi

change_case:

This program converts all lowercase characters into uppercase and vice versa.

// sample input:
String s = "Did yOu LiKe ThIS RePoSItoRy"

// output: 
dID yOu lIkE tHis rEpOsiTOry

concat_ThreeWords:

This program concats three words and displays the resultant string

// sample input
I
Love
Coding

// output
I Love Coding

count-letter-frequency:

This program counts the frequency of each and every character in the string

// sample input: 
Did you like this repository?

// output: 
. 	5
?	1
D	1
d	1
e	2
h	1
i	4
k	1
l	1
o	3
p	1
r	2
s	2
t	2
u	1
y	2
there are 16 different alphabets in : Did you like this repository? 

increment vowels:

This Program increments the ASCII value of each vovel in a string.

longest word:

This Program finds the longest word in a string. If there are 2 or more strigs with the same length then it displays the first word with that length

// sample input
How are you doing today

// output
The longest word is : doing and is : 5 characters long.

piglatin:

This program converts a word into piglatin form

reverse:

This program reserses a string

// sample input:
Hello there!!

// output: 
!!ereht olleH

About

Programs that include working with String objects

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages