Junior 2 (string)
1. Write a program remove character '0' from "Bill Gates capuital: $103.7 billion".
Bill Gates capuital: 13.7 billion
2. Write a program to check if a string starts with a specified word.
Note: Suppose the sentence starts with "Hello"
Input a string : Hello how are you?
True
3. Write a C# program to check if "Java" appears at second position in a string and returns the string without "Java".
Input a string : Java Tutorial
Tutorial
4. Write a program to create a new string from a given string where the first and last characters will change their positions.
Input a word: dog
god
5. Write a program to convert a given string into lowercase.
Input a string: Bill Gates
bill gates
6. Write a program to find the longest word in a string.
Input a string: IT WILL HAPPEN ANY DAY NOW
HAPPEN
7. Write a program to create a new string of four copies, taking last three characters from a given string.
Input a string : WE’RE PLANNING TO MOVE IN THE NEAR FUTURE
URE URE URE URE
8. Write a program to create a new string where the first 5 characters will be in lower case. If the string is less than 5 characters then make the whole string in upper case.
Input a string: Bill
BILL
9. Write a program to create a new string of every other character (odd position) from the first position of a given string.
Input a string : TIME WILL TELL
TM IL EL