Training Session # 1

EXercise1:

Implement in two different ways string length without using function length().

EXercise2:

Returns the how many words in a text line.

EXercise3:

Write a program to check if a given letter is present in a given word.

EXercise4:

Write a program to capitalize the first letter in each word in a text.

Exp: “Hello you, how are you?” → “Hello You, How Are You?”

Exercise5 (with solution):

Swapping Pairs of Characters in a String in Java. Given string str, the task is to write a Java program to swap the pairs of characters of a string. If the string contains an odd number of characters then the last character remains as it is